Answers for "unity unity child"

C#
8

unity access child

// To acces a child of a gameObject use the combination below
parentGameObject.transform.GetChild(0).gameObject
Posted by: Guest on February-20-2020
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