Contents

parent

The parent entity.

Declaration

@MainActor @preconcurrency var parent: Entity? { get }

Discussion

An entity has at most one parent entity. If an entity isn’t part of a hierarchy, or if it is a root entity, the parent property is nil.

Use the setParent(_:preservingWorldTransform:) method to change an entity’s parent. Use the removeFromParent(preservingWorldTransform:) method to remove the parent. These methods automatically update the corresponding children collections of the new and old parent.

See Also

Managing the parent