Hi,(I’m half asleep at the moment so I apologise in advance if my code is incorrect)
I’m having problems deleting multiple objects. The Destroy function doesn’t seem to take GameObjects[ ] so I was wondering if anyone knows an alternative to this. My snippet of code so far
var myTriggers : GameObjects[];
function Update() {
myTriggers = GameObject.FindGameObjectsWithTag("triggers");
Destroy(myTriggers);
}
The theory is essentially this: Loop through each GameObject in the array and destroy them one by one. If Javascript doesn’t have foreach, it surely would have “while” loops, which you can use to achieve similar things.