<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/HasHierarchy/removeFromParent(preservingWorldTransform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12HasHierarchyPAAE16removeFromParent24preservingWorldTransformySb_tF"
  },
  "title" : "removeFromParent(preservingWorldTransform:)"
}
-->

# removeFromParent(preservingWorldTransform:)

Removes the entity from its current parent or from the scene if it is a
root entity.

```
@MainActor @preconcurrency func removeFromParent(preservingWorldTransform: Bool = false)
```

## Parameters

`preservingWorldTransform`

A Boolean that you set to `true` to preserve
the entity’s world transform, or `false` to preserve its relative
transform. Use `true` when you want a model to keep its effective
location and size within a scene.

## Discussion

This method behaves like the
[`setParent(_:preservingWorldTransform:)`](/documentation/RealityKit/HasHierarchy/setParent(_:preservingWorldTransform:)) method with a
value of `nil` for the `parent` parameter, except that method has no
effect on root entities. A root entity is one that is stored in a
scene’s [`anchors`](/documentation/RealityKit/Scene/anchors) collection.

The [`children`](/documentation/RealityKit/HasHierarchy/children) collections of any modified parent
entities are automatically updated as well.

---

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)