<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Entity/ChildCollection/replaceAll(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC15ChildCollectionV10replaceAllyyxSTRzAC7ElementRczlF"
  },
  "title" : "replaceAll(_:)"
}
-->

# replaceAll(_:)

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

```
@MainActor @preconcurrency func replaceAll<S>(_ children: S) where S : Sequence, S.Element : Entity
```

## Parameters

`children`

The list of the new children.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)