Constraint Actuator Location: max

max
  • gets/sets maximum distance of the location constraint on the selected world axis

Type: 
  • float number
Note:
  • The Location Constraint creates an area which the Game Object can't leave.
     
  • Uses the World Axis.
     
  • Limits movement to area defined by Min and Max.
Sample Code


################  Get the max distance from the selected world axis

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

# max distance
max_length = act.max
 
Sample Code


################  Set the max distance from the selected world axis

# 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 maximum distance to 3.00
act.max = 3.0