---
title: "replaceAll(_:preservingWorldTransforms:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/entity/childcollection/replaceall(_:preservingworldtransforms:)-4mgff"
---

# replaceAll(_:preservingWorldTransforms:)

Removes all children from this entity and adds the specified list of entities as the new children.

## Declaration

```swift
@MainActor @preconcurrency func replaceAll(_ children: [Entity], preservingWorldTransforms: Bool = false)
```

## Parameters

- `children`: The list of the new children.
- `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

### Replacing entities

- [replaceAll(_:preservingWorldTransforms:)](realitykit/entity/childcollection/replaceall(_:preservingworldtransforms:)-1vwk4.md)
