duration
duration
gets/sets the number of
frames the sensor waits after sending a positive pulse before
it sends a negative pulse.
Type: integer
Sample
Code
################ Get duration
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named
sensor
sen = controller.sensors["sensor"]
# get the duration
dur = sen.duration
################ Set duration
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named
sensor
sen = controller.sensors["sensor"]
# set the duration
sen.duration = 3
|