Sensor Logic Brick: reset

reset()
  • Resets the sensor to it's initial state.  (ie. just activated)
Sample Code


################  reset the sensor
 
# import bge module

import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the sensor attached to the controller
# my sensor is named Sensor_1

sen = cont.sensors["Sensor_1"]

# reset the sensor
sen.reset()