Property sensor

A property sensor will be triggered when the value of a given property matches an evaluation

Option(s) of the Near sensor :

Common options of all Sensors
see below

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.value : gets/sets the value (as a string) the sensor uses to evaluate the property
  • sen.mode : gets/sets the Evaluation Type : 1 = Equal, 2 = Not Equal , 3 = Interval , 4 = Changed
  • sen.propName : Get/set the name of the Property that the sensor is evaluating

Note:

  1. Property being monitored must be on the same game object as the Property Sensor
  2. To add a propriety to an object : Logic Editor menu » View » Properties » Add Game Property
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License