“Jedność zdobądź dziecko” Kod odpowiedzi

Dostęp do jedności dziecko

// To acces a child of a gameObject use the combination below
parentGameObject.transform.GetChild(0).gameObject
SkelliBoi

Jedność zdobądź dziecko

GameObject Child;
Child = transform.GetChild(0).gameObject;
Artyom Gabtraupov

Jedność jak zdobyć dziecko z gameObject

//For unity engine
GameObject.transform.GetChild(The child index).transform;
Open Oryx

Unity Zdobądź 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;
Ill Impala

Jedność Znajdź dziecko po imieniu

   aFinger = transform.Find("LeftShoulder/Arm/Hand/Finger");
Rich Rattlesnake

Jedność zdobądź dziecko


GameObject originalGameObject = GameObject.Find("MainObj");
GameObject child = originalGameObject.transform.GetChild(0).gameObject;

Evil Elephant

Odpowiedzi podobne do “Jedność zdobądź dziecko”

Pytania podobne do “Jedność zdobądź dziecko”

Więcej pokrewnych odpowiedzi na “Jedność zdobądź dziecko” w C#

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu