Skip to content

Entity.IsActive Property

Definition

Namespace: Brine2D.ECS

Indicates whether this entity is active in the world. Inactive entities are skipped by the ECS processing and excluded from queries.

C#
public bool IsActive { get; set; }

Property Value

System.Boolean

Remarks

This property is non-cascading: toggling a parent's IsActive does not automatically propagate to children. Child entities retain their own IsActive state and will continue to be processed even when a parent is deactivated.

To toggle an entire hierarchy together, use SetActiveHierarchically\(bool\) which cascades the value down through all descendants.

When changed, OnActivated() or OnDeactivated() is called on this entity, and cached queries that filter by active state are invalidated. Additionally, OnEnabled() / OnDisabled() is called on each currently-enabled component, and OnEnabled() / OnDisabled() is called on each currently-enabled behavior.