distance
distance
gets/sets the distance that the game object has been set to maintain
from
the surface of an object.
Type: float
Note:
Distance Constraint only
Sample
Code
#################### Get distance
# get the controller
controller = GameLogic.getCurrentController()
# get the constraint actuator attached to the
controller named act
act = controller.actuators["act"]
# get the distance to stay above surface.
dist = act.distance
#################### Set distance
# get the controller
controller = GameLogic.getCurrentController()
# get the constraint actuator attached to the
controller named act
act = controller.actuators["act"]
# set the distance to stay above surface.
act.distance = 0.5
|