- Home /
Comparing Tag Groups
So I noticed that one can group tags in the tag/layer manager- ie. "Item/pickup" I was wondering if there was a way to check if an object is just in a specific group. Like in the Item/pickup example, I just want to know if the object is in the "Item" group. Thanks Much! -LMan
Hey i did not know how to contact you otherwise but you commented one of my questions and Yes you would make me verry happy and maybe ican help you to i am nu Pro Programmer But Im alot Better with 3Ds $$anonymous$$ax!
Do not post comments as Answers, use the add new comment button
I also have no idea who you were addressing this to (this is not a BB in any case) so I have converted it to a comment on the question. Please refrain from posting either answers or comments like this as it makes things very messy.
People have the same user names on the forum and you can P$$anonymous$$ them there.
Answer by SubatomicHero · Jun 04, 2013 at 07:25 AM
Hey,
Yes, its a simple if check:
if (gameObject.tag == "pickup"){
// Do stuff because I am a pickup
}
Or if you have multiples tags you could check it using a switch:
switch (gameObject.tag){
case "pickup":
// Do stuff here
break;
case "item":
// etc
break;
case "player"
// etc
break;
default:
// this case must be included
break;
}