- Home /
Deleting gameobject with tag problem
ok so I think im doing this right but it does not work So i have a model with 3 other models attached to it in 3ds max. I put a tag on the 3 objects that I want to get rid of when I want to. So this is what I am doing in code
var chute : GameObject[];
function Start ()
{
chute = GameObject.FindGameObjectsWithTag("Parachute");
}
and then in the update method
if(onGround)
{
for (var items in chute)
{
Destroy(items);
}
}
So what is it that im doing wrong here? Thanks for any help with this
Answer by KingKongFu · Oct 05, 2012 at 08:57 PM
I got this figured out I did not have the if statement in the main update method it was not calling it correctly so it only worked some of the time. Yeah trial and error right!
Your answer
Follow this Question
Related Questions
difference between GameObject.FindGameObjectWithTag(Tag tag) and GameObject.FindWithTag(Tag tag) 3 Answers
Non-static member 2 Answers
My Tags are getting changed, when its loaded from Asset Bundle. 1 Answer
SetActive not reactivating with Tags 2 Answers
How to check a collided gameobject for valid tags? 2 Answers