Skip to content

Parent

const Parent: Component

Attaches an entity to a parent (set it with attach): every frame, before drawing, its Position becomes the parent’s drawn position plus (x, y) turned by the parent’s Rotation, its z the parent’s plus z, and its Rotation (if it has one) the parent’s plus angle. A weapon in a hand, a health bar over an enemy, a group of UI elements. Chains work. When the parent is despawned, the child is despawned with it.