Quantcast
Channel: Answers for "How to get all GameObjects in Scene?"
Viewing all articles
Browse latest Browse all 20

Answer by jonc113

$
0
0
I have found that FindObjectOfType will return all kinds of weird things that are not in the scene. "activeInHeirachy" solves the problem: object[] allObjects = FindObjectsOfTypeAll(typeof(GameObject)) ; foreach(object thisObject in allObjects) if (((GameObject) thisObject).activeInHierarchy) print(thisObject+" is an active object") ;

Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>