godot-python icon indicating copy to clipboard operation
godot-python copied to clipboard

Rotate and export variable not working

Open distantforest1 opened this issue 5 years ago • 1 comments

Before I start I want to say thanks to everyone for making the Python implementation. GdScript is ok, but having Python is incredibly powerful. Hopefully one day it can be one of the mainstay languages along side GdScript and C# in godot.

That being said, I'm having quite a lot of issues here unfortunately... here are two of them:

Rotation not working I'm trying to get a sprite to rotate but it doesn't seem to do anything. Here is the code

from godot import exposed, export, signal, Vector2, Sprite

@exposed
class IconScript(Sprite):
	game_finished = signal()

	# member variables here, example:
	a = export(int, default=4)
	b = export(str, default='foobar')
	ce = export(int, default=4)

	def _ready(self):
		"""
		Called every time the node is added to the scene.
		Initialization here.
		"""
		print("Initialize")

	def _process(self, delta):
		self.rotation_degrees -= 100 * delta 
		# self.rotate(100 * delta) # this doesnt work either
		print ("print is working though")

The gdscript equivalent works (rotation_degrees += 100 * delta). Anyone know whats happening here?

Export Variables Export variables doesnt seem to update in the Editor until you restart the project.

Using godot-python-v0.20.1-windows-64. Godot_v3.2.1-stable_mono_win64.

distantforest1 avatar Mar 21 '20 13:03 distantforest1

I thing python also needs to be build everytime like for c# but as python is not official for Godot that's why there's no build option out there for python that's why you have to restart your project everytime

Harshharsh2275 avatar Oct 11 '20 07:10 Harshharsh2275