- Home /
Select a child's variables from the parent.
How can I select my child's variables from the parent, for example if I have a player and want and have a weapon as a child with a script how can I access its variables?
Comment
Answer by Uzquiano · Apr 24, 2011 at 11:30 PM
Take a look to this
http://unity3d.com/support/documentation/ScriptReference/GameObject.GetComponent.html
http://unity3d.com/support/documentation/ScriptReference/Component.GetComponentInChildren.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613125034im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Make a simple tree 1 Answer
Destroy(transform.root.gameObject ); 2 Answers
Is there a way to make a selected object a child of another object during the game? 1 Answer
Find 1st child of root 2 Answers