range
range
gets/sets
the distance the ray is checking.
Type: float
Sample
Code
###############
Get range
# get the controller.
controller = GameLogic.getCurrentController()
# get the Ray sensor attached to the controller named
GuardDuty
ray = controller.sensors["GuardDuty"]
# get distance guard is checking
dist = ray.range
###############
Set distance
# get the controller.
controller = GameLogic.getCurrentController()
# get the Ray sensor attached to the controller named
GuardDuty
ray = controller.sensors["GuardDuty"]
# set distance guard is checking
ray.distance = 3.0
|