Skip to content

@modoki/engine / index / ControlClipBlock

Interface: ControlClipBlock

One clip on a control track — one of three kinds, discriminated by which field is set:

  • prefab spawn (prefab = a GUID): instantiate at start, destroy the instance at start + duration (or leave it if duration is omitted). Spawned UNDER the track target (the Director root when target is "").
  • particle restart (particle: true): RESTART the track target's ParticleEmitter at start (re-emit from t=0), and pause it at start + duration if a duration is set. Acts ON the track target (needs an entity carrying a ParticleEmitter).
  • sub-director (subdirector: true): drive the track target's own Director (a nested .timeline.json) SYNCED to this clip — its local time = parentTime − start, playing across [start, start + (duration ?? childDuration)]. Composes reusable sub-cutscenes; runtime-Play only (see timelineSystem). Acts ON the track target (needs an entity carrying a Director). The three are mutually exclusive; normalizeTrack drops a clip that is none.

Timeline

duration?

optional duration?: number


particle?

optional particle?: boolean


prefab?

optional prefab?: string


start

start: number


subdirector?

optional subdirector?: boolean


transform?

optional transform?: Partial<Record<"x" | "y" | "z" | "rx" | "ry" | "rz" | "sx" | "sy" | "sz", number>>

PREFAB kind only — a per-field LOCAL Transform override for the spawned instance root (under the track target). Only the fields present override the prefab's authored root; omit for the prefab's own pose. Lets one prefab spawn at different places/rotations/scales per clip.

Built with Modoki.