localPosition
localPosition
gets/sets the object's local position
Type: list [lx, ly, lz]
Sample Code
################# Get localPosition
# get the controller
controller = GameLogic.getCurrentController()
# get the game object that the controller is attached
to.
obj = controller.owner
# get local position
pos = obj.localPosition
################# Set localPosition
# get the controller
controller = GameLogic.getCurrentController()
# get the game object that the controller is attached
to.
obj = controller.owner
# set local position
obj.localPosition = [ 1.0, 0.5, 3.0]
|