Delay sensor

Option(s) of the Delay sensor :

  • Delay : The delay in logic tics before a pulse is sent.
  • Duration : The number of logic tics the Sensor is active. A negative logic tic is sent when the Sensor is deactivated. ( Duration = 0: Sensor is never deactivated )
  • Repeat : Restarts the Delay sensor when the Delay and Duration logic tics are completed
  • common options of all Sensors

Python :

# import bge module
import bge
# get the controller
cont = bge.logic.getCurrentController()
# get the sensor attached to the controller
# my sensor is named Trigger
sen = cont.sensors["Trigger"]
  • sen.delay : gets/sets the number of frames the delay sensor waits before sending a positive pulse to the controller (0 to 5000)
  • sen.duration : gets/sets the number of frames the sensor waits after sending a positive pulse before it sends a negative pulse. (0 to 5000)
  • sen.repeat : repeat the cycle (delay/duration) over and over. ( = 1 ) or only once (=0 )
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License