Parent Actuator Remove Parent: mode

mode
  • gets/sets the type of Parent Actuator

Type: 
  • integer

Values:

  • 1 = Set Parent
     
  • 2 = Remove Parent
Remove Parent:
  • Removes the Parent/Child connection.
Set Parent:
  • Parents this object to another.
Sample Code


################  Get the type of Parent Actuator being used

# import bge module
import bge

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

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

act = cont.actuators["Follow"]

# get the type of Parent actuator
type = act.mode
 
Sample Code


################  Set the type of Parent Actuator being used

# import bge module
import bge

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

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

act = cont.actuators["Follow"]

# set the mode to Set Parent
act.mode = 1