Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity get all children

foreach (Transform child in parent) {
  //Your code
}
Comment

unity get list of children

List<Transform> children = new List<Transform>(transform.GetComponentsInChildren<Transform>());
//!!!!DISCLAMER!!!! This will also include the parent object for whatever reason.
//Heres a less elegant solution that wont include parent:
List<Transform> children = new List<Transform>();
foreach (Transform tr in transform) children.Add(tr);
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# initialize array 
Csharp :: c# reverse a string 
Csharp :: unity unparent 
Csharp :: unity agent bake not derecting mesh 
Csharp :: unity knowing when 0 input is pressed 
Csharp :: unity gameobject to mouse 
Csharp :: get length of enum values 
Csharp :: Tower of Hanoi c# 
Csharp :: get logged in user name c# 
Csharp :: c# read char 
Csharp :: c# paste from clipboard 
Csharp :: create models from database ef core 
Csharp :: c# get pixel color from image 
Csharp :: alphabet string[] c# 
Csharp :: how to move mouse in c# 
Csharp :: c# clear a textbox 
Csharp :: ggdesign 
Csharp :: c# postmessage mouse click 
Csharp :: how to execute linux command from c# 
Csharp :: content type application/json c# 
Csharp :: varibles c# 
Csharp :: how to convert nullable datetime datarow to datetime in c# 
Csharp :: using serial port in c# 
Csharp :: c# socket listen on port 
Csharp :: all month in array 
Csharp :: c# filter list 
Csharp :: how to move a gameobject to another object 
Csharp :: c# how to write an array in a single line 
Csharp :: how to print hello world in c# 
Csharp :: c# making a folder 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =