Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to get an child of an gameobject

// By Name
GameObject Child = GameObjectsTransform.Find("NameOfChild").gameObject

// By index
GameObject Child = GameObjectsTransform.GetChild(The child index).gameObject
Comment

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;
Comment

unity how to get a child from a gameobject

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

PREVIOUS NEXT
Code Example
Csharp :: unity print to console 
Csharp :: json stringify c# 
Csharp :: unity color set alpha 
Csharp :: add two numbers in c# 
Csharp :: c# set a guid 
Csharp :: C# previous method 
Csharp :: path desktop c# 
Csharp :: serilog loglevel order 
Csharp :: bold caption latex 
Csharp :: random from list c# 
Csharp :: query parameter c# controller 
Csharp :: how to get all files from folder and subfolders in c# 
Csharp :: unity disable cursor 
Csharp :: c# date formats custom 
Csharp :: stop process c# 
Csharp :: How to read StreamReader text line by line 
Csharp :: unity object follow mouse 
Csharp :: unity how to add force 
Csharp :: unity how to summon an object with code 
Csharp :: get apps execution path with app name c# 
Csharp :: mouse click unity raycast unity 
Csharp :: unity change tag of go 
Csharp :: unity rotate vector 
Csharp :: load prefab in script unity 
Csharp :: print unity 
Csharp :: c# get calling method name 
Csharp :: c# add 1 
Csharp :: check if panel has controler c# 
Csharp :: c# get bits from float 
Csharp :: C# get enum value by DescriptionAttribute 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =