I want to go through all objects tagged “bowling” and delete them
This is my currecnt code:
var bowling;
if (bowling == null)
GameObject.FindGameObjectsWithTag ("bowling");
for (var bowl : GameObject in bowling)
Destroy(bowl);
}
But it does not work
Thank you in advance
I have a couple of things that might help you, the first is that you have a closed parentheses at the bottom which hasn’t been opened which may just be a copying error:
for (var bowl : GameObject in bowling)
Destroy(bowl);
} <------this here
My other suggestion is that you might want to try assigning this line to a variable:
GameObject.FindGameObjectsWithTag ("bowling");
which could be written as:
bowling = GameObject.FindGameObjectsWithTag ("bowling");
I hope this helps your problem.