Documentation / scene / AnimationTimelineStep
Type Alias: AnimationTimelineStep
AnimationTimelineStep = {
type:"play";clip:string;id?:string;options?:PlayAnimationOptions;wait?:"complete"|false; } | {type:"stop";target?:string;options?:StopAnimationOptions; } | {type:"wait";seconds:number; } | {type:"waitEvent";event:string; } | {type:"waitMarker";marker:string;target?:string; } | {type:"waitFrame";frame:number;target?:string; } | {type:"emit";event:string;payload?:unknown; } | {type:"sequence";steps:AnimationTimelineStep[]; } | {type:"parallel";steps:AnimationTimelineStep[]; }
Defined in: libs/scene/src/animation/animationtimeline.ts:163
One executable instruction in an animation timeline.
Union Members
Type Literal
{ type: "play"; clip: string; id?: string; options?: PlayAnimationOptions; wait?: "complete" | false; }
type
type:
"play"
Start an animation clip playback.
clip
clip:
string
Name of the animation clip to play from the owning AnimationSet.
id?
optionalid?:string
Optional local reference id used by later target fields in this runner.
If a later step replaces the same logical playback and future responses should keep using this name, assign the same id again on the replacement play step.
options?
optionaloptions?:PlayAnimationOptions
Playback options passed to AnimationSet.play.
wait?
optionalwait?:"complete"|false
Whether to block the timeline on this playback before advancing to the next step.
'complete': wait until the playback completes or is stopped.falseor omitted (default): start the playback and immediately continue.
A clip that loops forever (repeat: 0) only completes when stopped, so combine wait: 'complete' with a finite repeat/range or an external stop.
Type Literal
{ type: "stop"; target?: string; options?: StopAnimationOptions; }
type
type:
"stop"
Stop a playback owned by this runner.
target?
optionaltarget?:string
Optional playback target id.
When omitted, all playbacks owned by the current runner are stopped.
options?
optionaloptions?:StopAnimationOptions
Stop behavior passed to the matching playback or playbacks.
Type Literal
{ type: "wait"; seconds: number; }
type
type:
"wait"
Wait for a fixed duration.
seconds
seconds:
number
Number of seconds to wait before continuing.
Type Literal
{ type: "waitEvent"; event: string; }
type
type:
"waitEvent"
Wait until a matching event is dispatched to the runner.
event
event:
string
Event name that releases the wait.
Type Literal
{ type: "waitMarker"; marker: string; target?: string; }
type
type:
"waitMarker"
Wait until a playback crosses a marker.
marker
marker:
string
Marker id or name to wait for.
target?
optionaltarget?:string
Optional playback target id; defaults to the current playback in scope.
Type Literal
{ type: "waitFrame"; frame: number; target?: string; }
type
type:
"waitFrame"
Wait until a playback crosses a frame number.
frame
frame:
number
Frame number to wait for.
target?
optionaltarget?:string
Optional playback target id; defaults to the current playback in scope.
Type Literal
{ type: "emit"; event: string; payload?: unknown; }
type
type:
"emit"
Emit a timeline event through the runner.
event
event:
string
Event name emitted to runner listeners.
payload?
optionalpayload?:unknown
Optional payload emitted with the event.
Type Literal
{ type: "sequence"; steps: AnimationTimelineStep[]; }
type
type:
"sequence"
Execute child steps sequentially.
steps
steps:
AnimationTimelineStep[]
Child steps run in order.
Type Literal
{ type: "parallel"; steps: AnimationTimelineStep[]; }
type
type:
"parallel"
Execute child steps as parallel branches.
steps
steps:
AnimationTimelineStep[]
Child steps that become isolated parallel branches.