I'm updating an objects location using a Simple Motion Actuator. I see it move on the screen.
In Python I want to get the objects' current position.
scene = bge.logic.getCurrentScene()
obj = scene.objects['Sphere.002'] # The object the actuators are defined on
obj.position
obj.worldPosition
obj.localPosition
I've tried these three methods of the object, but all of them only show the original position of the object, not the current position based on the changes made by the logic bricks.
Here's another example of what I'm doing wrong, it seems to be the same problem.
I have a text object, I've defined a text game property that I increase or decrease with a keyboard sensor. When I print the value of the text it only prints the original value of 0.5 not the value I see on the screen.
print(bge.logic.getCurrentScene().objects['mytextobject'].text)
This always prints the original value, not the value that is updated from the logic bricks. This must be a trivial error, but I can't figure out what to do. I've looked at all the properties of the scene.object
and I don't see anything that looks like it might give me the expected result.
'Sphere.002'
never move. Please add some images. $\endgroup$