Constraint Actuator Distance: damp

damp
  • gets/sets the number of frames to use for damping of the constraint.

Type: 
  • integer
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 damping of the distance constraint

# 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 damping
dist_damping = act.damp
 
Sample Code


################  Set the damping of the distance constraint

# 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 damping to 5 frames
act.damp = 5