Skip to content

Timeline

A Sequencer timeline coordinates movement, sprite animation, sound and camera shots. Each .estimeline file holds one timeline. An .esanimator file holds an animation controller and defines transitions between states.

Already have a track? Jump to choosing a sound or binding another entity.

Pick a sprite you can see in a 2D scene, such as a character named Hero. This example moves its X position from 0 to 120 in one second. The same steps work on a 3D object with a distance suited to your scene.

  1. Create the timeline. Open the destination folder in the Content Browser and choose Add → New Animation. The editor creates NewAnimation.estimeline and opens it in the Sequencer. You can also open Panels → Sequencer on the left toolbar and click New animation in the empty panel. To edit an existing timeline, double-click its file.

    The New animation button in an empty Sequencer

  2. Bind the character and set the starting position. Select the character in the World Outliner. The link button at the upper left of the Sequencer should show its name. If it reads Unbound, click it. Click Jump to start to put the playhead at frame 0. Open + Track, scroll to Property (from the bound entity) and choose position.x for Transform. The Sheet adds a channel and places the first key at the character’s current X position.

    The property section of the Track menu with position.x highlighted for Transform

  3. Set the end position at one second. Click the ruler at 1.00 s (frame 12 at the default 12 fps). Hover over the position.x row on the left and click its diamond Key at playhead button. Click the new key in the lane on the right, enter 120 in Details → Value and press Enter. The Sheet now shows 2 keys in its footer. If your object started at 120, choose a different end value.

    The second key is selected at frame 12, its value is 120 in Details, and the Sheet counts two keys

  4. Preview and save. Drag the playhead back to frame 0, then scrub slowly to frame 12. Watch the character move in the scene viewport. You can also click the triangle in the Sequencer to play the clip. Click Save at the upper right of the Sequencer to write the keys to the .estimeline file.

To record a movement, follow step 2 first. Keep the character selected, move the playhead to one second, and click the red record button next to the link button. Drag the character along its X axis with the Move tool, or edit its X position in the character’s Details. Click record again to finish. Recording keys existing property channels on the bound object and also edits the object’s scene properties. Editing the key’s value as in step 3 preserves the object’s original scene position.

To play the timeline when the game starts, select the same character in the World Outliner. In Details → Add Component, search for TimelinePlayer and add Timeline Player. Assign the saved .estimeline to Timeline, enable Playing, save the scene and press Play on the editor’s main toolbar. If the clip previews in the Sequencer but the character stays still in the game, check which entity has the player and which file it references.

  1. Find the audio file you want to use in the Content Browser, for example Intro.mp3. Open the timeline and move the playhead to the time the sound should start, such as one second.

  2. Choose + Track → Audio and pick (timeline root) or a child. The Sequencer creates and selects a sound item at the playhead. No sound means the item is ready for a file. If Details shows track settings, click the diamond in the lane to inspect the item.

  3. In an editor build with the picker fix, click None ▾ in Details → Audio → Sound and choose Intro.mp3. The Sound field now shows the filename. Click Save in the Sequencer.

    The fixed Sound picker listing the project files Bell.wav and Intro.mp3

  4. Listen. The default Length of zero makes a one-shot. Save, run the scene from the main toolbar and let the playing timeline cross the item to hear it. To audition a span in the Sequencer, set Length to a positive value such as two seconds and start playback before the item. The diamond becomes a bar.

The TimelinePlayer component points an entity at a timeline asset. Usually set in the editor; in code, insert it with Commands:

import { defineSystem, Commands, TimelinePlayer } from 'esengine';
const attach = defineSystem([Commands()], (cmds) => {
cmds.spawn().insert(TimelinePlayer, {
timeline: 'assets/timelines/intro.estimeline',
playing: true,
speed: 1.0,
wrapMode: 'once',
});
});
Property Type Default Description
timeline asset '' The timeline asset (.estimeline).
playing boolean false The play flag — raise to play, lower to pause. Raising it on a finished clip replays from the top.
speed number 1 Playback rate multiplier.
wrapMode string '' Overrides the clip’s own wrap mode: 'once', 'loop', or 'pingPong' (camelCase). Empty — and any other string, which counts as a typo — leaves the mode the clip declares standing.
finished boolean false Latched true when a 'once' clip completes; cleared on the next play. Runtime, read-only.

The component flags are the playback control: the engine reconciles them into its internal clock every frame, so anything that flips playing — your code, the inspector, an AI action — drives the clip through the same channel.

Read the Timeline resource to drive an entity’s timeline:

import { defineSystem, Query, Res, TimelinePlayer, Timeline } from 'esengine';
const control = defineSystem([Query(TimelinePlayer), Res(Timeline)], (q, timeline) => {
for (const [entity] of q) {
timeline.play(entity);
timeline.pause(entity);
timeline.stop(entity);
timeline.setTime(entity, 1.5); // seek to 1.5s
const t = timeline.getCurrentTime(entity);
const playing = timeline.isPlaying(entity);
}
});
Method Description
play(entity) Start or resume playback (a finished clip replays from the top).
pause(entity) Pause, keeping the current time.
stop(entity) Stop, reset to the start, and clear the finished latch.
setTime(entity, seconds) Seek to a time (scrubs all tracks).
getCurrentTime(entity) Current playhead time in seconds.
isPlaying(entity) Whether it’s currently playing.

These methods write through to the TimelinePlayer flags — timeline.play(e) and player.playing = true are the same operation on the same channel.

A TimelinePlayer can play a stretch of its timeline, as UE’s playback range does: rangeStart to rangeEnd seconds (0 is the timeline’s end). It starts at the range’s start, a once timeline finishes at its end, and a looping one loops within it. unscaledTime runs the player on real time, so a cutscene or a menu animation plays on while the game is paused with Time.scale at 0 (Unity’s Unscaled Game Time).

What a player does is sent as a TimelinePlayback event, read the next frame, as Unity’s PlayableDirector played, paused and stopped events and UE’s OnPlay, OnPause, OnStop and OnFinished are:

import { defineSystem, EventReader, TimelinePlayback } from 'esengine';
const onCutscene = defineSystem([EventReader(TimelinePlayback)], (events) => {
for (const e of events) if (e.kind === 'finished') giveControlBack(e.player);
});
kind When
played The player starts, or resumes from a pause.
paused It stops where it is (Timeline.pause, or playing lowered).
stopped It is stopped and rewound (Timeline.stop).
finished A once timeline reaches its end (or its range’s).
looped A looping or ping-pong timeline comes round.

A timeline is a set of tracks evaluated together each frame:

Track TrackType Drives
Property Property Keyframed component fields — position / rotation / scale and any numeric dot-path.
Sprite frames AnimFrames Swap sprite-sheet frames over time.
Sprite clip SpriteAnim Start a named anim-clip at a time.
Audio Audio Sounds: a moment fires the whole sound once; a clip with a length is heard over its span (see below).
Activation Activation Switch an entity on and off over ranges, its children with it; UINode.display on a UI node (see below).
Spine Spine Play Spine animations as clips.
Particles Particle Play, stop or reset the target entity’s particle emitter at a particular time.
Marker Marker Named time markers, sent to the game as a TimelineEvent when crossed.
Custom event CustomEvent Named events with a payload (and an optional window), sent as a TimelineEvent (see below).
Camera Camera Which camera is the view, shot by shot (see below).
Sequence Sequence Another timeline, played inside a window of this one.
Animation Animation Skeletal animation clips on a rig, eased and crossfaded over its own animation (see below).
Spawn Spawn Entities made from a prefab while the playhead is inside a clip (see below).
Camera shake CameraShake Camera shakes at moments (see below).

UE’s Fade and Time Dilation tracks are two components a timeline keys on ordinary property tracks, so a script can use them too. The Sequencer’s Track → Fade and Track → Time dilation add the component to the root if it has none and a track with a key at the playhead.

Component Field Description
ScreenFade amount How far the screen is faded, 0 (clear) to 1 (the colour). The strongest fade there is is drawn over everything, 2D and 3D, its own UI canvas above the game’s, and never takes the pointer.
color The colour faded to.
TimeDilation scale How fast the game runs while it is on: 0.25 is slow motion. Several multiply, and they multiply the game’s own Time.scale, so a game paused at 0 stays paused and gets its own speed back when the dilation ends.

Both act in play. While the Sequencer previews a timeline, the fade at the playhead is drawn over the scene view and the camera preview too, as UE’s viewport shows a Fade track, without changing the scene’s own value; the slower clock is seen only in play.

An audio track’s item is a moment until it has a length: the whole sound, fired once as the playhead crosses its time. Give it a duration and it is a clip, as in Unity’s Timeline and UE’s Sequencer: heard only while the playhead is inside it, from clipIn seconds into the sound, rising over fadeIn and falling over fadeOut, repeated to fill it with loop. A paused timeline pauses it; a playhead that lands inside it (a seek, a loop back) starts it where the playhead is, so the rest of a line of dialogue is heard rather than its start; it stops at its end. The Sequencer draws a clip as a bar with its fades as ramps, and plays its clips while it plays, and a moment of them where the playhead is scrubbed to.

{ "type": "audio", "childPath": "", "events": [
{ "time": 1, "clip": "@uuid:…", "volume": 0.8, "duration": 4, "clipIn": 0.5, "fadeIn": 0.5, "fadeOut": 1 }
] }

An animation track plays skeletal animation on a rig, as Unity’s Animation Track and UE’s Skeletal Animation track do. Each clip plays an animation (an .estimeline of joint curves, as importing a model writes them) on the track’s entity:

Clip field Default Description
clip '' The animation it plays, by asset ref.
start / duration Where it sits on the track, in seconds.
clipIn 0 Seconds into the animation it starts from.
speed 1 Playback speed.
loop false Repeat the animation to fill the clip instead of holding its last frame.
easeIn / easeOut 0 Seconds to blend in from, and back out to, the rig’s own animation.
preExtrapolation / postExtrapolation none What the clip plays before it (when it is the first) and after it, until the next clip: hold, loop, pingPong or continue.

Where two clips overlap, the overlap is a crossfade: the earlier fades out as the later fades in. Where a clip eases in or out, it blends with the rig’s own pose: its Animator’s for that frame when it has one (the timeline runs after the Animator, so at full weight the track decides the pose), and otherwise its rest pose. Between clips the rig is its own again; set the track’s hold to keep the last clip’s final pose after it ends. The Sequencer draws the ease as a ramp at a bar’s end and the crossfade as a hatch over the overlap, and its preview plays the blend.

A clip can also go on outside itself, as Unity’s clip extrapolation does: hold keeps its end frame, loop and pingPong repeat its span forwards or back and forth, and continue keeps playing its animation on. Post-extrapolation fills the time after a clip until the next one starts; pre-extrapolation fills the time before the track’s first clip. An extrapolated end does not ease: the clip stays at full weight across it. The Sequencer draws the stretch a clip fills as a faint dashed band, and the clip’s Details sets both as Before and After. The track’s hold is every clip’s Hold where it names none.

Layers. Several animation tracks on the same rig are layers, in track order, as Unity’s override tracks and the Animator’s layers are. The first meets the rig’s own pose; each later track is set on the track:

Track field Default Description
blend override override leans the pose of the tracks above toward its own; additive adds what its clips move beyond their own first frame (where the clip starts in its animation), so a lean or a flinch reads the same over any pose.
weight 1 How much of the track there is, 0 to 1.
mask all The joints it may move (Unity’s Avatar Mask): paths below the rig, each with everything under it.
rootMotion false Move the rig by its clips’ root motion (see below).

So a wave on the upper body over a walk is a second track masked to Spine, and a breath is an additive track at a low weight. They are the track’s, not a clip’s: click the track’s row in the Sequencer and the Details shows them under Blending, beside the track’s name, mute and lock, as Unreal shows a track’s properties. Mask is an array, as Unreal lists a blend mask’s branches: each element is a joint picked from the rig, and brings its whole branch. A clip’s own Details are in sections too: Section (when it plays), Animation, Easing and Extrapolation.

Root motion. A clip’s root track (the Transform position and rotation at the animation’s own root) normally poses the rig like any joint, so a walk plays on the spot it was made at. Turn on the track’s rootMotion (Root motion in the Details) and it says where the character goes instead, as Unity’s Apply Root Motion does: the root track is left out of the pose and the rig is moved by how far the clip’s root has travelled since the clip began, from where the rig stood. What moves the rig is each clip’s motion scaled by its weight, as in Unity: clips follow on, so two walks in a row go twice as far; a looping clip keeps travelling lap after lap; a clip easing in starts the rig off slowly and one easing out brings it to a stop; a crossfade blends the two clips’ steps; and after the last clip the rig stays where it got to. A clip’s post-extrapolation carries on its motion: loop keeps walking, pingPong walks back and forth, continue plays on in its animation and hold stands still. The travel turns with the rig, so a character facing another way walks that way. It is worked out from the clips at every time, never added up frame by frame, so scrubbing, seeking and looping put the rig in the same place each time, and the scene’s own position is left as it was.

A camera shake track fires shakes at moments, as UE’s Camera Shake track does and as a Cinemachine impulse is fired from a Unity timeline. Each item is a time and a force (1 as authored). What a shake does depends on the track’s entity:

  • With a CameraImpulseSource (see Cameras) it fires an impulse from where that entity is, at force times the source’s strength: every camera with a CameraImpulseListener feels it by its distance, so a blast beside the camera jolts it and one across the level barely trembles.
  • Without one (a track on the root, say) the view in use is shaken where it is, force times a default shake.

In play, shakes move only what is drawn, never a camera’s Transform. The Sequencer’s preview shows them as you scrub, as UE’s viewport shows a Camera Shake section: the camera the shot is from (or the scene’s active one) is moved as the shakes leave it at the playhead, worked out from the shakes before it with the same noise play uses, so the same time always shakes the same way. The camera is put back once the shakes are over, and the scene’s own camera is never changed.

A spawn track brings entities in for a while, as UE’s spawnables and the prefab of Unity’s Control track do: a dragon that flies through a cut scene need not stand hidden in the level the rest of the time. Each clip names a prefab and the name its instance is given:

Clip field Description
start / duration When the instance exists: made as the playhead enters the clip, taken away as it leaves.
prefab The prefab it makes, by asset ref.
name What the instance is called.

The instance is made under the track’s entity (the root for a track on the root), so the timeline’s other tracks address it by its name like any child: a property, animation or camera track with the path Dragon moves, animates or films the spawned Dragon while it is there and does nothing while it is not. Stopping the timeline, or its player going away, takes every instance away. The prefabs a timeline spawns are loaded as soon as its player has the timeline, playing or not, and once loaded an instance is made on the spot: it is there on the frame its clip starts, for the tracks that address it that same frame, as a UE spawnable is. (A clip that starts before its prefab has loaded gets its instance when the files land, if the playhead is still inside it.) In the editor the Sequencer’s preview makes the instance too, posed by those tracks as you scrub, but it is never an entity of the scene: it is not listed, and it is not saved.

An activation track says this child is on for these spans — which is how a chest opens (a closed image hands over to an open one partway through, along with its glow), how a badge appears at the end of a flourish, how any two-state widget is animated.

What it writes depends on what the target is:

  • An entity is switched on and off whole, as Unity’s Activation Track sets a GameObject active: everything under it goes with it (a character and its sword, a lamp and its light), and a switched-off entity is out of every query, not just unpainted. A renderer’s own enabled is left as the author set it.
  • A UI node gets UINode.display. A UI node’s show/hide is display, which also takes the subtree with it.

Either way the write only happens when the state actually flips, so a track that is not moving does not dirty change detection every frame.

A track names its target by a path below the entity that plays the timeline. A path that starts @Name goes through a binding instead: the entity the playing TimelinePlayer binds Name to, anywhere in the scene, with the rest of the path below it (@Hero/Arm). That is Unity’s PlayableDirector binding and UE’s possessable: a cutscene moves things that are not its children, and one timeline played by two players drives two different characters.

TimelinePlayer field Description
bindingNames The names of the player’s bindings.
bindings The entity each name is bound to, in the same order; carried to the loaded entities like any entity reference.

Suppose the player is on Stage, Hero is its child, and Spotlight is elsewhere in the scene. Check that the link button in the Sequencer names Stage as the preview root.

  • Control a child. Choose + Track → Active → Hero. The track finds Hero by its path below Stage.
  • Control an entity elsewhere. Choose + Track → Active → Bound entity… → Spotlight. This creates or reuses the Spotlight binding on Stage’s Timeline Player and sets the track’s target to @Spotlight. If the submenu says the root has no player, add Timeline Player to Stage first.
  • Retarget an existing binding. Select Stage in the World Outliner and open Details → Timeline Player → Bindings. Each row shows the binding name on the left and an entity dropdown on the right. There is no add button here. Save the timeline and the scene, then run the scene to check visibility over the active range.

The Active track submenu offers the child Hero directly and the external entity Spotlight under Bound entity

Event and marker tracks tell the game what the timeline is doing, as Unity’s Signals and UE’s event tracks do. Each one the playhead crosses is sent as a TimelineEvent, with the entity its track is about; a system reads them the next frame:

import { defineSystem, EventReader, TimelineEvent } from 'esengine';
const onCue = defineSystem([EventReader(TimelineEvent)], (events) => {
for (const e of events) {
if (e.name === 'door-open') openDoor(e.target);
if (e.kind === 'event') console.log(e.payload); // a marker's payload is empty
}
});
Field Type Description
kind 'event' | 'marker' An event track’s item, or a marker.
name string Its name, as authored.
payload object An event’s data; empty for a marker.
time number Where it sits in the clip, in seconds.
player Entity The entity playing the timeline.
target Entity The entity its track is about (the player for a track on the root).

Each is sent once per pass; a loop sends it again on the next lap. An event with a window (duration) is also reported as open for that long to an Animator state that plays the timeline.

In a visual script. Each named one is also sent as the entity event timeline:<name> (a marker named boom is timeline:boom), to the entity its track is about and then up to the player, as Unity’s Signal Receiver hears a signal on the bound object. A visual script’s On Event node with that type reacts to it: its target is the track’s entity and its other the player. The node hands on the fields of the event’s payload that it declares as its Inputs (select it and they are in the Details, a name and a type each, as a UE Custom Event’s are), each a typed pin: the parameters of a Unity signal’s receiver, UE’s event payload. The event’s own time and name can be declared the same way. A graph on a door hears the events of the door’s own track; a graph on the entity playing the timeline hears all of them. The same event reaches an event binding or a state machine on those entities, and timelineSignalType(name) spells the type in code.

To explore a finished cutscene, open the Cutscene example and double-click assets/timelines/intro.estimeline in the Content Browser. The Sheet shows tracks and current values on the left and a frame ruler on the right. Drag the playhead across the ruler to scrub. On the two Hero position channels, circles and diamonds indicate different interpolation modes. The two green bars below keep the top and bottom letterbox bars active for their respective spans.

The cutscene Sheet with the Hero position keys above two three-second letterbox activation ranges

Switch to Curves. The red curve moves the character into the shot along X, and the green curve moves it up and down. Click a key on the green curve to reveal its two tangent handles. Drag the key to change its time and value, or drag a handle to adjust the slope at that key.

A selected key on the character’s height curve with its frame, value and two tangent handles

Ctrl+wheel over the lanes zooms the time axis about the pointer (the time under it stays under it), the ruler growing finer ticks as it does; the lanes then scroll sideways, and the view keeps the playhead in sight while playing. Fit brings the whole timeline back. Every marker of a marker track is also drawn on the ruler by name; clicking one jumps the playhead to it, as UE’s marked frames do.

A drag over empty lanes draws a box: the keys and clips it touches are selected (Shift or Ctrl adds to the selection, as does Shift/Ctrl-clicking one). Dragging any selected item moves all of them, keys and clips of every track together, as one undo step; a locked track’s items stay where they are. With a selection:

Key Does
Ctrl+C / Ctrl+X Copy / cut it.
Ctrl+V Paste it at the playhead, the same shape, into the tracks and channels it came from.
Ctrl+D Duplicate it right after itself.
S Split each selected clip the playhead is inside: the second part carries on where the first stopped (an animation’s or a sound’s Clip In moves on by the time cut off), and the cut is a hard edge, with no ease or fade on either side of it.
Delete Delete it.
Ctrl+A Select every key and clip.

A clip’s right-click menu has Split, Copy and Paste too. A click on one item of a selection selects it alone.

Open + Track and pick an entity track such as Audio, Active, Animation, Spawn or Camera shake. Choose (timeline root) or one of its descendants. The first item appears at the playhead. Drag the body of a clip to move it, or an edge to change its duration. A particle action, marker or event at a single instant can be dragged along the lane.

For tracks that accept multiple items, the row’s + adds another at the playhead. Click an item and edit its sound asset, volume, animation name or event data in Details. Press Delete to remove the selection.

Each track row has a mute (the eye) and a lock, as in Unity’s Timeline and UE’s Sequencer. Both are saved with the timeline. A muted track, or a muted property channel, is left out wherever the timeline plays: in the game, in an Animator state that plays it, in a nested sequence and in the Sequencer’s preview. A locked track cannot be edited until it is unlocked; its items can still be selected, and it can still be muted. Right-click a track for its menu: mute, lock, Move to group (into an existing folder or a new one), rename and delete. Folders (Unity’s Track Groups) collapse like any row; double-click a folder or a track’s name to rename it. In the file they are muted, locked and group on a track and muted on a channel, written only when set.

A camera track holds shots: each bar is one camera that is the view for its span. Bars that touch cut; drag a bar so it overlaps the previous one and the overlap becomes a blend, shaped by the later shot’s blend curve. A span with no shot gives the view back to the scene’s own camera. There is one camera track per timeline, and its cameras must sit below the timeline’s root (every track finds its target by name path from that root).

A sequence track plays another .estimeline inside a window of this one, on its own clock: speed scales it, and loop repeats it to fill the bar instead of holding its last frame. Bind to picks the node the nested timeline’s name paths start from, so one greeting sequence can play on different characters. A timeline cannot play itself, directly or through another, and nesting stops at four levels; the editor refuses those picks, and a loaded game skips them with a warning.

Scrubbing shows the cut in the viewport’s camera preview window. Dragging, jumping or playing backwards is safe: which shot and which nested frame are showing is a function of time alone. Events inside a nested timeline fire only while it plays forward, like any other.

Render in the Sequencer’s header makes the timeline into pictures, as UE’s Movie Render Queue and Unity’s Recorder do. Pick the frame rate (24, 30 or 60), the format (MP4, WebM, or PNG frames alone) and the stretch to render. The render plays the game, not the preview: the timeline’s TimelinePlayer (the preview root’s) in Play, with every system the game runs, paused and stepped exactly one frame of the render at a time, each frame read back from the game’s own canvas. So a render is the same picture every time, however fast the machine is. Frames are written to renders/<timeline>-<time>/frame_00000.png in the project and the video beside them (renders/<timeline>-<time>.mp4), encoded with the ffmpeg the editor ships. Play is left as it was found, and Cancel stops between frames.

Scrub the playhead to see property-channel values in the scene viewport. Run the scene to check activation ranges, sprite animation starts and one-shot sounds. The link button names the preview root. Tracks can animate that root, its descendants, or other scene entities explicitly bound through the player.

When you open a timeline, the Sequencer looks for a TimelinePlayer that plays this file on the selected entity or its ancestors, then for the first matching player in the scene. If there is no matching player, it uses the current selection. When the button reads Unbound, select the target in the World Outliner and click the link button.

An agent driving the editor over MCP builds a timeline with the Sequencer’s own commands, in the timeline tool group: timeline_add_track adds a track of any type on an entity (named by id or by its name path below the player), timeline_add_items puts shots, clips, sounds, spawns, markers and events on it with their fields named as the file stores them, and timeline_set_keys keys an animatable field, making its property track. Each call is one undo step, and a wrong name (a field the track does not have, an entity not under the player, a field that cannot be animated) is refused with the right ones. save_asset_document writes the file.

An .estimeline document is plain data — the TimelineAsset type plus the TrackType / InterpType / WrapMode constants let you build one entirely in code. Register it on the Timeline resource, and any TimelinePlayer whose timeline names it plays it like an authored asset — a name registered in code wins over a loaded .estimeline of the same name:

import {
defineSystem, Commands, Res, Timeline, TimelinePlayer,
TrackType, InterpType, WrapMode, type TimelineAsset,
} from 'esengine';
const slideIn: TimelineAsset = {
version: '1.3',
type: 'timeline',
duration: 2,
wrapMode: WrapMode.Once,
tracks: [{
type: TrackType.Property,
name: 'Slide in',
childPath: '', // '' = the player entity itself
component: 'Transform',
channels: [{
property: 'position.x',
keyframes: [
{ time: 0, value: -200, inTangent: 0, outTangent: 0, interpolation: InterpType.EaseOut },
{ time: 2, value: 0, inTangent: 0, outTangent: 0 },
],
}],
}],
};
const attach = defineSystem([Commands(), Res(Timeline)], (cmds, timeline) => {
timeline.registerAsset('code/slide-in', slideIn);
cmds.spawn().insert(TimelinePlayer, {
timeline: 'code/slide-in',
playing: true,
wrapMode: 'once',
});
});

A Keyframe is { time, value, inTangent, outTangent, interpolation? }. The segment starting at a keyframe uses that keyframe’s interpolation: Hermite (the default — tangent-driven curves), Linear, Step, EaseIn, EaseOut, or EaseInOut. A property track resolves its target entity by childPath (child names separated by /; empty = the player entity) and writes the channel’s dot-path field on the named component.

A clip declares its own numeric WrapMode (on the asset and in the pure evaluation API); the player component’s wrapMode string, when it names one, overrides it. The mapping and behavior:

WrapMode Player string Behavior past the end
WrapMode.Once (0) 'once' Clamp at duration, stop, latch finished.
WrapMode.Loop (1) 'loop' Wrap around (time % duration).
WrapMode.PingPong (2) 'pingPong' Play forward then backward each cycle.

applyWrapMode(time, duration, mode) is the pure mapping itself — it returns { time, stopped } for an absolute clock time.

The evaluator is pure TypeScript, shared by playback and the editor’s scrub — you can call it yourself:

Function Description
sampleTimelineInWorld(asset, time, world, rootEntity, opts?) Evaluate every property track at time and write the results into the world (the scrub operation).
sampleTimeline(asset, time, rootEntity, deps, opts?) Same, with injected SampleDeps (world / component lookup / child resolver) — for tests and tooling.
evaluateChannel(channel, time) Value of one property channel at time; endpoints clamp.
serializeTimelineAsset(asset) The asset as a JSON-ready object (the .estimeline document shape).
serializeTimelineToJson(asset, indent?) Pretty-printed .estimeline JSON string (indent defaults 2).

Sampling covers property tracks; event-like tracks (audio, markers, custom events) fire edge-detected during playback, not on a sample.

Timelines are an optional module: a package carries the runtime and the loader when a scene has a TimelinePlayer, the content has an .estimeline, or a script imports esengine/timeline. A game with none of them ships neither.

  • Author in the Sequencer — the timeline asset holds the tracks; code just plays and seeks it.
  • wrapMode: 'once' for cutscenes, 'loop' for ambient/idle sequences.
  • Scrub with setTime to preview or sync a cutscene to gameplay state.
  • Use a timeline (not tweens) when many properties/entities animate in lockstep; reach for tweens for one-off single-property juice.