Constraint Actuator Distance: limit

limit
  • gets/sets world/local/normal axis the distance constraint is using
     
  • Distance Actuator name: Direction

Type: 
  • integer

Values:

  • 7 = positive X axis
     
  • 8 = positive Y axis
     
  • 9 = positive Z axis
     
  • 10 = negative X axis
     
  • 11 = negative Y axis
     
  • 12 = negative Z axis
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 game object axis to be constrained

# 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"]

# axis constrained
constrained = act.limit
 
Sample Code


################  Set the game object axis to be constrained

# 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 positive x-axis to be constrained
act.limit = 7