---
tags:
    - "Transform"
---

# Transform Detach Children

[Transform](../index.md) / [Hierarchy](index.md) / **Transform Detach Children**

## Description

Unparents all children

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Transform Detach Children")]
    [Category("Transform/Hierarchy/Detach Children")]
    [Description("Unparents all children")]
    
    [Image(typeof(IconHanger), ColorTheme.Type.Lime, typeof(BadgeCross))]
    [Keywords("Transform")]
    
    [Serializable]
    public class GenInstructionTransform_DetachChildren_0 : Instruction
    {
        [SerializeField] private GetGameObject m_Transform = new GetGameObject(
            new GenTypeGameObject_Transform()
        );
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Detach Children");
            return $"{this.m_Transform} {method}";
        }
        
        protected override Awaitable Run(Args args)
        {
            Transform component = this.m_Transform.Get<Transform>(args);
            if (component == null) return Done;
            
            component.DetachChildren();
            
            return Done;
        }
    }
}


```

