Class KX_ParentActuator (2.48)


Methods
getObject
setObject
 
Variables
---------- ----------
 
Constants
---------- ----------

Inherited Methods:  Class SCA_ILogicBrick
getExecutePriority setExecutePriority
getOwner ----------

Inherited Methods:  Class PyObjectPlus
isA ----------

Inherited Methods:  Class Value
getName ----------



Methods



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)



Blender 3D
Game Engine