Finding The Number GameObject with Same Tag

In Unity 2d/3d game to count the number of game object with the same tag we use as following code :
int t = GameObject.FindGameObjectsWithTag("tile").Length;

Here , total number of GameObject with the tag "tile" in the Current is stored in the variable t.

Comments

Popular Posts