Answers for "unity find child by name"

C#
17

find child of gameobject unity

gameObject.transform.Find("ChildGameObject").gameObject;

//This insures that you are finding the child instead of finding another
//GameObject's Child.
Posted by: Guest on May-31-2020
11

unity get child

GameObject Child;
Child = transform.GetChild(0).gameObject;
Posted by: Guest on February-21-2020
5

unity get child gameobject

//Instantiate Prefab
GameObject originalGameObject  = Instantiate(prefab);

//To find `child1` which is the first index(0)
GameObject child2 = originalGameObject.transform.GetChild(0).gameObject;

//To find `child2` which is the second index(1)
GameObject child2 = originalGameObject.transform.GetChild(1).gameObject;

//To find `child3` which is the third index(2)
GameObject child3 = originalGameObject.transform.GetChild(2).gameObject;
Posted by: Guest on October-17-2020
2

get gameobject child by name

Gameobject.Find("ChildName") ;
Posted by: Guest on March-25-2020
0

unity find child by name

aFinger = transform.Find("LeftShoulder/Arm/Hand/Finger");
Posted by: Guest on October-11-2021

C# Answers by Framework

Browse Popular Code Answers by Language