Quantcast
Channel: Answers for "Destroy all gameObjects with tag in one line"
Browsing latest articles
Browse All 4 View Live

Answer by n1gth

You have to loop. But you could make it very slightly more efficient by keeping a list of all objects that you want to Destroy, and then going through that, rather than having to do the Find first.

View Article



Answer by NeverHopeless

As I see you can have a look at these ways: 1. Using `System.Linq` namespace, no need of additional loop: GameObject.FindGameObjectsWithTag ("yourTag").Select(c => Destroy(c)); 2. Using parent /...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images