- Home /
Best Answer
Answer by aldonaletto · Jul 28, 2012 at 01:22 AM
FindGameObjectsWithTag creates an array with references to all game objects that have the specified tag. You definitely can't convert an array of GameObject to int, but can get its length:
var objects: GameObject[] = GameObject.FindGameObjectsWithTag("SomeTag");
var howMany = objects.length; // get the array length
Thank you, that's exactly what I wanted (to beginners, who are viewing this post - note, that '0' also counts)
Your answer
Follow this Question
Related Questions
I need to store the amount of objects in scene in a var. How? 1 Answer
If GameObject with tags not on scene 1 Answer
How to find layer instead of tags 3 Answers
How to find a prefab in another scene? 1 Answer
GameObjectWithTag Child 1 Answer