Property Sensor Changed: propName

propName
  • gets/sets the name of the Property that the sensor is evaluating
  • Property Sensor name: Property

Type: 
  • string
Property Sensor:
  • Property being evaluated has to be on the same game object as the sensor
     
  • Property Sensor is triggered when the Evaluation Type is met.
     
  • One positive pulse is immediately followed by a negative pulse.
Sample Code


################  Get the Property name.
  
# import bge module
import bge

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

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

sen = cont.sensors["Die"]

# get the name of the property
name = sen.propName
 
Sample Code


################  Set the property name being evaluated.
  
# import bge module
import bge

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

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

sen = cont.sensors["Die"]

# Set the property name
sen.propName = "Health"