

delay
- gets/sets the number of frames the delay sensor waits before sending a positive pulse to the controller
- integer
Range:
- 0 to 5000
Delay Sensor:
- The Delay Sensor delays sending a pulse to the controller.

Sample Code

################ Get delay
# import bge module
import bge
# get the controller
cont = bge.logic.getCurrentController()
# get the sensor attached to the controller
# my sensor is named Recharge
sen = cont.sensors["Recharge"]
# get number of frames the sensor is delayed
frame_delay = sen.delay
Sample Code

################ Set delay
# import bge module
import bge
# get the controller
cont = bge.logic.getCurrentController()
# get the sensor attached to the controller
# my sensor is named Recharge
sen = cont.sensors["Recharge"]
# set number of frames the sensor is delayed
sen.delay = 3