| Class KX_ParentActuator (2.48) |
|
|
| getExecutePriority |
setExecutePriority |
| getOwner |
---------- |
|
|
getObject
getObject()
Returns the name of the parent.
Return Type: string
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named act
act = controller.getActuator("act")
# get parent
parent = act.getObject()
setObject
setObject(parent)
Sets the parent
parent:
Type: string (object name without OB in
front of it.)
or
KX_GameObject
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named act
act = controller.getActuator("act")
# get a list of the objects in the scene
objList = GameLogic.getCurrentScene().getObjectList()
# use Cube1 as parent
parent = objList["OBCube1"]
# set parent
act.setObject(parent)
# use it
GameLogic.addActiveActuator(act, True)
|