|
setParentsetParent(parent, compound, ghost)Parents an object to another object.parent: Type:
KX_GameObject
compound: Type: int
1 = the
child's shape is combined with the parent's shape.
0 = the child's shape is kept separate from the parent's shape. ghost: Type: int
1 = child
is set to ghost
0 = child is solid Note: Object type:
Sensor. Child is always a ghost.
Sample Code# get the current scenescene = GameLogic.getCurrentScene()# get a list of objects in sceneobjList = scene.objects# get the object named Cube from the listcube = objList["OBCube"]# get the object named Suzannesuz = objList["OBSuzanne"]# make cube a child of suz, combine shapes, no ghostcube.setParent(suz, 1, 0) |