- Home /
Question by
bpears · Jan 23, 2013 at 11:05 PM ·
getcomponentsendmessagegameobject.find
Best way to access variables of script from granchild of another object, into a different script?
Whats the best way? Could you use tags, use GameObject.Find("object").GetComponent(script);..(not sure how you would find a granchild object this way), use sendmessage(heard it is bad to do), or some other method?
Comment
Best Answer
Answer by cdrandin · Jan 23, 2013 at 11:07 PM
Something like this other.transform.parent.GetComponent("Script").variable = variable;
Your answer
![](https://koobas.hobune.stream/wayback/20220613091506im_/https://answers.unity.com/themes/thub/images/avi.jpg)