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);
     }
 }
Source by coders911.org #
 
PREVIOUS NEXT
Tagged: #reference #child #gameobject #unity
ADD COMMENT
Topic
Name
2+2 =