EntitiesSamples/Docs/transforms.md
The LocalTransform component represents the transform of an entity, and entity transform hierarchies are formed with three additional components:
Parent component stores the id of the entity's parent.Child dynamic buffer component stores the ids of the entity's children.PreviousParent component stores a copy of the id of the entity's parent.To modify the transform hierarchy:
Parent component to parent an entity.Parent component to de-parent it.Parent component to change its parent.The ParentSystem updates the Child and PreviousParent components to ensure that:
PreviousParent component that references the parent.Child buffer component that references all of its children.| ⚠ IMPORTANT |
|---|
Although you can safely read an entity's Child buffer component, you should not modify it directly. Only modify the transform hierarchy by setting the entities' Parent components. |
Every frame, the LocalToWorldSystem computes each entity's world-space transform (from the LocalTransform components of the entity and its ancestors) and assigns it to the entity's LocalToWorld component.
| 📝 NOTE |
|---|
The Entity.Graphics systems read the LocalToWorld component but not any of the other transform components, so LocalToWorld is the only transform component an entity needs to be rendered. |