unity count objects with tag code example
Example: how to find the number of objects with the same tag in unity
if(GameObject.FindGameObjectsWithTag("Enemy").Length > 20) { // Do something }
if(GameObject.FindGameObjectsWithTag("Enemy").Length > 20) { // Do something }