Skip to content

@modoki/engine / index / Director

Variable: Director

const Director: Trait<{ lastTime: number; loop: boolean; playing: boolean; speed: number; started: boolean; time: number; timeline: string; }>

Director — plays a .timeline.json sequence against this entity and its descendants.

The PlayableDirector analog. timeline is a GUID referencing a .timeline.json asset (resolved via the asset manifest); the entity carrying the Director is the binding root, and every track targets a descendant by relative name-path (same model as Animator + .anim.json). Switch/scrub the sequence via time; playing gates advance; speed scales the playhead; loop wraps vs. clamps at duration.

The playhead advances on the DETERMINISTIC sim delta (getSimDelta), so markers / audio cues / activation edges land on exact ticks and the whole sequence is reproducible under stepSimulation. lastTime/started are runtime read-back (never serialized): the timeline system uses lastTime for edge detection and started to fire the once-only sequence-start fan-out.

Built with Modoki.