- Home /
Question by
oliver-jones · Nov 27, 2010 at 04:27 PM ·
parentchildtag
Access Parent NameTag?
Hi,
I have a script as a child of an object. The parent has a dynamic name tag. How would I be able to read what the parents tag is if the script is a child.
EG:
Parent Tag = Select.
Child Script = if(ParantTag("Select"){ ....
Comment
Best Answer
Answer by Mike 3 · Nov 27, 2010 at 05:38 PM
Something like this:
if (transform.parent != null && transform.parent.tag == "Select")
{
}