Constraint Actuator Distance: propName

propName
  • gets/sets the name of the property/material the distance constraint looks for

Type: 
  • string
     
  • blank (ie nothing) = react to all property/materials
Note:
  • The Distance Constraint sets the target distance of the Game Object
     
  • Uses the World or Local Axis
     
  • Distance is measured from the Object Center of the Game Object
Sample Code


################  Get the property/material the distance constraint looks for

# import bge module
import bge

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

# get the actuator attached to the controller
# my actuator is named Max_Height

act = cont.actuators["Max_Height"]

# constraint property/material name
name = act.propName
 
Sample Code


################  Set the property/material the distance constraint looks for

# import bge module
import bge

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

# get the actuator attached to the controller
# my actuator is named Max_Height

act = cont.actuators["Max_Height"]

# set the property name to "Enemy"
act.propName = "Enemy"