Contents

isEnabled

A Boolean that you set to enable or disable the entity and its descendants.

Declaration

@MainActor @preconcurrency var isEnabled: Bool { get set }

Discussion

Set this value to true to enable the entity. Unless an ancestor is disabled, the entity and all of its enabled descendants, up to the first that’s disabled, report isEnabledInHierarchy of true. If an ancestor is disabled, they all report false. The state of isActive for enabled entities is true if they are anchored, or false otherwise.

If you disable an entity, it and all of its descendants become both disabled (isEnabledInHierarchy returns false) and inactive (isActive returns false), regardless of any other state.

When an entity is disabled, it’s no longer visible in your scene. However, the entity is still included in an EntityQuery.

See Also

Managing the entity’s state