checking to see if multiple (different) tags are destroyed

hello neighbors! another little conundrum for you brilliant and tech savvy genius’ at unity answers!
i have a little destroy check script here.

  1. function Update() {
    var enemies = GameObject.FindWithTag(“EditorOnly”); //find gameobjects with the tag “EditorOnly”
    if(enemies == null){

ok, great. this kinda works. problem is… when i send one object into my destroy trigger with (tag)… all of them are destroyed because they all have the same tag. so now i need to re-tag all of the objects i want to be destroyed individually. and i need this script to check for each of the tags… and not load my deathscene level until all of them return (null)
any help would be great… i will be posting a second part to this puzzle that focus’ on the actual destroy object scripts. but i really need to get this working first.
thanks again and i hope to hear from you!

If i understand it right, the deadscene1 is loaded, when there are no enemies left in the current scene.

“when i send one object into my destroy trigger with (tag)”

Do you refer with this ‘destroy trigger’ the script snippet you use above ?

for your second snippet i show you an example of the principle

var tags = ["fluf1", "fluf2", "fluf3", "fluf4", "fluf5", "fluf6",];

function Update() {
if (tags.length == 0) { /// checks if the array empty
} }

But i think your making things too complicated for yourself this way.

I think you are approaching the problem backwards. You should tag all your items the same…give them all a ‘fluf’ tag for example. If you need to distinguish between the various fluf objects, then either give them unique names (not unique tags) like (‘fluf1’, ‘fluf2’…), or attach a script to your fluf game objects with a string for a name. You can use GetComponent() to get the script and then the name. If there is a really compelling reason to use this many different tags, you will need to make multiple FindWithTag() calls, one for each tag. You can use an array of tag names and then use a for loop to cycle through the list.