Skip to content

Entity.SetParent(Entity) Method

Definition

Namespace: Brine2D.ECS

Sets the parent of this entity.

C#
public Brine2D.ECS.Entity SetParent(Brine2D.ECS.Entity? newParent);

Parameters

newParent Entity

Returns

Entity

Exceptions

System.InvalidOperationException
Thrown when newParent belongs to a different world than this entity.

Remarks

Self-parent and circular-hierarchy attempts are silently ignored and this entity is returned unchanged. Cross-world parenting still throws because it indicates a clear programming error with no safe fallback.