Answers for "unity how to get children gameobject in editor"

C#
3

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);
     }
 }
Posted by: Guest on July-28-2021

Code answers related to "unity how to get children gameobject in editor"

C# Answers by Framework

Browse Popular Code Answers by Language