# DetachChildren()

> Unparents all of the target object's children.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void DetachChildren()
```

### Remarks

Each immediate child is moved to the root-level, preserving their internal hierarchies. This is useful if you want to destroy the root of a hierarchy without destroying the children, and is more efficient than unparenting each child individually.

Additional Resources: [TransformHandle.parent](/engine/6000.5/script-reference/unityengine/transformhandle/parent.md) to detach/change the parent of a single transform.
