Skip to content

@modoki/engine / index / TrackKind

Type Alias: TrackKind

TrackKind = "animation" | "signal" | "audio" | "activation" | "control"

Timeline / sequencer data model — the on-disk .timeline.json asset format.

A timeline orchestrates EXISTING engine subsystems (animation, actions, audio, activation) on a shared time axis; it does not reimplement them. Like an AnimationClipDef, it is a REUSABLE, binding-free asset: every track targets an entity by a relative name-path from the entity that carries the Director trait (the "root") — "" is the root, "body/arm" is the descendant reached by matching child EntityAttributes.name. So one cutscene plays against any subtree whose child names match (Unity Timeline's asset/PlayableDirector split).

The playing INSTANCE state (playhead time, speed, loop, playing) lives on the Director trait, never in the asset — same as Animator vs .anim.json.

v1 track kinds (each drives a subsystem the timeline does NOT own):

  • animation → the target's animator (Animator/SpriteAnimator/SkeletalAnimator), selected by clip NAME. A keyframe Animator is scrubbed to an exact sample; skeletal/sprite are start-and-let-the-mixer-run.
  • signal → a zero-duration marker that dispatchGameActions at its tick.
  • audio → cues a sound (cueClip) at its tick.
  • activation → toggles the target's EntityAttributes.isActive for a span.
  • control → instantiates a PREFAB at a clip's start (parented under the track target) and destroys it at the clip's end — Unity's Control Track, prefab flavour. A spawned prefab can carry a ParticleEmitter, so this covers "spawn an effect on a beat". (Particle-system restart + nested sub-directors deferred.)

Built with Modoki.