Constraint Actuator Distance: option

option
  • gets/sets the sum of the option values

Type: 
  • integer
Values:
  • Normal button:
    • Enabled: 64
       
    • Disabled: 0
  • M/P button:
    • Enabled (set to Material): 128
       
    • Disabled (set to Property): 0
  • PER button:
    • Enabled: 256
       
    • Disabled: 0
  • Force Distance button:
    • Enabled: 512
       
    • Disabled: 0
  • Local button:
    • Enabled: 1024
       
    • Disabled: 0
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
Examples:
  • Local button = 0 + 0 + 0 + 0 + 1024 = 1024
     
  • PER button + Local button = 0 + 0 + 256 + 0 + 1024 = 1280
     
  • PER button + Distance button + Local button = 0 + 0 + 256 + 512 + 1024 = 1792
Sample Code


################  Get the sum of the option values

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

# sum of the option values
sum = act.option
 
Sample Code


################  Set the sum of the option values

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

# Enable Local + PER buttons
# Disable all other buttons

act.option = 1280