Game Object: children

children
  • Returns a list of the children of an Object.

Return Type:
  • list [ KX_GameObject ]
Note:
  • Returns empty brackets [] if there aren't any children objects.
Sample Code

################## get a list of the object's children
   
# import bge
import bge

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

# get object that controller is attached to
obj = cont.owner

# get a list of the object's children
childList = obj.children