How to count and name total number of game object are there in my scene?

So basically i just want to count how many game object are there in my scene.
Is there any special built in function ?

1 Answer

1

This should work:

GameObject.FindObjectsOfType(typeof(MonoBehaviour)); //returns Object[]

See here for other solutions: How to get all GameObjects in Scene? - Unity Answers.

I would search for Transform instead, since every GameObject has a Transform component, but not every GameObject might have a MonoBehaviour component.

Page Not Found

Nevertheless, BiG's answer is correct.

Remove the final dot from the URL.

hummm... got it and done.