Game Object: groupMembers

groupMembers
  • Returns a list of members of the group the game object belongs to

Return Type:

  • list [ KX_GameObject ]
Note:
  • Game Object belongs to a group: Returns a list of the group members
     
  • Game Object doesn't belong to a group: Returns None

 

Sample Code

################### get a list of the group members
  

# 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 group members
memList = obj.groupMembers