Game Development Community

[Solved] how can I know how many objects in the scene

by Amjad Yahya · in Torque Game Builder · 07/30/2010 (5:01 pm) · 4 replies

Is there a method or function that tell us how many objects are there in the current scene, something like this:

getObjectsCount()

Thanks.

#1
07/30/2010 (5:09 pm)
The way I handle it is to maintain a list of objects using a SimSet. This way I'm tracking the objects that matter.
#2
07/30/2010 (5:51 pm)
You can call getSceneObjectCount() on the t2dSceneGraph object since all objects need to belong to a scene graph to be in the game.

Kevin's advice is a more controlled, cleaner way to manage scene objects.
#3
07/30/2010 (6:26 pm)
Cool! I didn't know about getSceneObjectCount(). But I can't think of a reason to use it at the moment.
#4
07/31/2010 (8:05 am)
Cool, that worked perfectly. Thanks to all of you