Answers for "unity destroy all objects with tag"

C#
1

unity destroy all objects with tag

GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");   
foreach(GameObject enemy in enemies)  
{
	GameObject.Destroy(enemy);
}
Posted by: Guest on July-30-2020
0

unity destroy all objects with tag

GameObject[] taggedObjects = GameObject.FindGameObjectsWithTag("Tag");   
foreach (GameObject object in taggedObjects) {
	Destroy(object);
}
Posted by: Guest on January-30-2021

Code answers related to "unity destroy all objects with tag"

C# Answers by Framework

Browse Popular Code Answers by Language