Answers for "c# unity child class"

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

C# Answers by Framework

Browse Popular Code Answers by Language