- Home /
Question by
wizardgames · Sep 14, 2016 at 12:40 AM ·
tagcheckclones
How to check if all clones of the same tag are destroyed?
How do I check if all clones of the same tag are destroyed? I instantiate an object and I need to know when all of it's clones are dead so I know if the player wins. I tagged the object with "Enemy" and used this:
void update()
{
if (GameObject.FindGameObjectsWithTag("Enemy") == null)
{
Debug.Log("Enemys are dead");
youwin = true;
}
if (youwin == true)
{
Debug.Log("YOUWIN");
}
}
but it isn't working can you please help me ASAP!? THANKS!
Comment