Skip to content

makeAttachSystem

makeAttachSystem<TCtx>(options?): SchedulableSystem<TCtx>

Defined in: src/modules/attach/attach.ts:50

Build a system that syncs attached entities to their parents each tick.

For each entity carrying AttachDef:

  • inheritVelocity — adds parent.velocity × dt to the child’s position.
  • snapPosition — sets the child’s position to the parent’s.
  • snapRotation — sets the child’s rotation to the parent’s.

Runs after movement so parents have settled into their final position.

TCtx extends AttachTickCtx

AttachSystemOptions = {}

SchedulableSystem<TCtx>