Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to reference a child gameobject unity

Transform[] transforms = this.GetComponentsInChildren<Transform>();
 
 foreach(Transform t in transforms)
 {
     if (t.gameObject.name == "Child")
     {
         Debug.Log ("Found " + t);
     }
 }
 
PREVIOUS NEXT
Tagged: #reference #child #gameobject #unity
ADD COMMENT
Topic
Name
3+5 =