---
title: "removeAll(keepCapacity:preservingWorldTransforms:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/entity/childcollection/removeall(keepcapacity:preservingworldtransforms:)"
---

# removeAll(keepCapacity:preservingWorldTransforms:)

Removes all children from this entity.

## Declaration

```swift
@MainActor @preconcurrency func removeAll(keepCapacity: Bool = false, preservingWorldTransforms: Bool = false)
```

## Parameters

- `keepCapacity`: true to keep the memory reserved for storing the children. false to free the reserved memory.
- `preservingWorldTransforms`: true to preserve the world transform. false to preserve the relative transform. (Use true if the entities should keep its effective location and size in the scene!)

## See Also

### Removing entities

- [remove(_:preservingWorldTransform:)](realitykit/entity/childcollection/remove(_:preservingworldtransform:).md)
- [remove(at:preservingWorldTransform:)](realitykit/entity/childcollection/remove(at:preservingworldtransform:).md)
- [removeAll(preservingWorldTransforms:)](realitykit/entity/childcollection/removeall(preservingworldtransforms:).md)
