I want to print the location of a moving block in bge. The mr, or “more right activator”, just gives the block a force of 5 in the x direction.
Here is what i have:
import PhysicsConstraints
import GameLogic
import bpy
block = bpy.data.objects["Cube"]
block_LocX = block.LocX
block_LocY = block.LocY
block_LocZ = block.LocZ
controller = GameLogic.getCurrentController()
senList = controller.sensors
actList = controller.actuators
r = senList["rightsensor"]
a = senList["always"]
mr = actList["moveright"]
if a.positive:
print block_LocX, block_LocY, block_LocZ
if r.positive:
controller.activate(mr)
However, the output is not what I intend:
0.0 0.0 3.5323240757
0.0 0.0 3.5323240757
0.0 0.0 3.5323240757
The x location does not change at all. And I am confused why I am only getting three rows.
Can anyone help me out here?
Thanks