---
title: "addChild(_:preservingWorldTransform:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/hashierarchy/addchild(_:preservingworldtransform:)"
---

# addChild(_:preservingWorldTransform:)

Adds the given entity to the collection of child entities.

## Declaration

```swift
@MainActor @preconcurrency func addChild(_ entity: Entity, preservingWorldTransform: Bool = false)
```

## Parameters

- `entity`:
- `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

Discussion See the HasHierarchy protocol’s definition of addChild(_:preservingWorldTransform:) for more information.

## See Also

### Managing children

- [children](realitykit/hashierarchy/children.md)
- [removeChild(_:preservingWorldTransform:)](realitykit/hashierarchy/removechild(_:preservingworldtransform:).md)
