Instance Method

removeChild(_:preservingWorldTransform:)

Removes the given child from the entity.

Declaration

func removeChild(_ entity: Entity, preservingWorldTransform: Bool = false)

Parameters

entity

The child entity to remove.

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

The child’s parent property is automatically updated.

See Also

Managing Children

var children: Entity.ChildCollection

The child entities that the entity manages.

func addChild(Entity, preservingWorldTransform: Bool)

Adds the given entity to the collection of child entities.

struct Entity.ChildCollection

A collection of child entities.