Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity delete all children

 foreach (Transform child in transform) {
     Destroy(child.gameObject);
 }
Comment

unity destroy all children

while (transform.childCount > 0) {
    DestroyImmediate(transform.GetChild(0).gameObject);
}
Comment

Unity Destroy All Children

void Update()
    {
    //put in any gameobject having children and enter playmode
        foreach (Transform child in transform)
        {
            Destroy(child.gameObject);
        }
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# custom comment tags 
Csharp :: read dxf file c# 
Csharp :: datagrid drop file wpf mvvm example 
Csharp :: split a datatable based on number of rows 
Csharp :: how to update modal class using dbfirst in asp.net core 
Csharp :: como ordenar dados na gridview c# 
Csharp :: How to solve error in ExecuteNonQuery() in asp.net 
Csharp :: how to destroy bridges animal crossing 
Csharp :: asp.net core reverse engineer database 
Csharp :: jtoken value is not exact double 
Csharp :: wpf settings core 
Csharp :: c sharp tenery operator with callin gmethods 
Csharp :: how to make dobuble jump unity 2d 
Csharp :: Get the Default gateway address c# 
Csharp :: how to backup terrain in unity 
Csharp :: bitwise even or odd 
Csharp :: visual studio debug copy byte[] from watch 
Csharp :: get access to all controls with a specific tag in C# 
Csharp :: how to create more accurate searching c# 
Csharp :: Precision comparison in C# 
Csharp :: struct 
Csharp :: 2d movement unity 
Csharp :: Compiling C# Example 
Csharp :: postgres .net 6 datetime issue 
Csharp :: C# .net JwtSecurityTokenHandler jwttoken claims to object 
Csharp :: FileSystemEventHandler raised twice 
Csharp :: c# online code editor 
Csharp :: qrcode c# 
Csharp :: convert array to list c# 
Csharp :: how to change the width of a panel unity 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =