worldPosition
worldPosition
gets/sets the Game Object world position
Type: float list
[ x, y, z]
Sample Code
################ Get worldPosition
# get the controller
controller = GameLogic.getCurrentController()
# get object that controller is attached to
obj = controller.owner
# get object's world position
pos = obj.worldPosition
################ Set worldPosition
# get the controller
controller = GameLogic.getCurrentController()
# get object that controller is attached to
obj = controller.owner
# set object's world position
obj.worldPosition = [ 1.0, 1.0, 2.0]
|