addChild(_:preservingWorldTransform:)
Adds the given entity to the collection of child entities.
Declaration
@MainActor @preconcurrency func addChild(_ entity: Entity, preservingWorldTransform: Bool = false)Parameters
- entity:
- preservingWorldTransform:
A Boolean that you set to
trueto preserve the entity’s world transform, orfalseto preserve its relative transform. Usetruewhen you want a model to keep its effective location and size within a scene.
Discussion
See the HasHierarchy protocol’s definition of addChild(_:preservingWorldTransform:) for more information.