FindWithTag returns only one object. You must use FindGameObjectsWithTag: it returns an array of objects with the specified tag - just sweep this array and destroy each element, like this:
if (gameover){ // you don't need to compare a boolean variable to true
var clones = GameObject.FindGameObjectsWithTag ("clone");
for (var clone in clones){
Destroy(clone);
}
}
Hi,
I am using this script you wrote for some time, but unless there is something wrong in my script, I think that there is an issue.
This removes all the taged objects except one. how can i remove ALL ?
Tnx,
Amit