dLoc
dLoc
gets/sets the amount (the displacement) the game object is to be moved.
Type: list [ dx, dy, dz]
dx:
Displacement applied on the x axis
Type:
float number
dy: Displacement applied on the y axis
Type:
float number
dz: Displacement applied on the z axis
Type:
float number
Sample Code
################## Get dLoc
# get the controller
controller = GameLogic.getCurrentController()
# get the object actuator attached to the controller
named act
actMotion = controller.actuators["act"]
# get amount to be moved
displacement = actMotion.dLoc
################## Set dLoc
# get the controller
controller = GameLogic.getCurrentController()
# get the object actuator attached to the controller
named act
actMotion = controller.actuators["act"]
# set amount to be moved
actMotion.dLoc = [ 0.1, 0.0, 0.0]
|