I’m trying to make a function that should destroy all objects with tag once.
Here is my script (It’s not working, unity just crashed).
public void DestroyAllEnemy()
{
while(GameObject.FindGameObjectsWithTag("Enemy")!= null)
{
Destroy(GameObject.FindWithTag("Enemy"));
}
return;
}