Timeline and Cutscenes
Multi-track direction inside Unity — animation, sound, and effects by timecode.
A cutscene in an FPS, an intro before a boss, the ritual of opening a door — all of these play out by a script, and writing it in code with timers is painful. Unity Timeline gives you a multi-track editor (like Premiere or DaVinci), where you can lay out animations, sounds, object activation, and signals into scripts.
What Timeline and PlayableDirector are
- Timeline Asset (
.playable) — an asset that describes the tracks and clips. - PlayableDirector — a component on a GameObject that plays back a Timeline Asset. It has bindings: for each track you specify which scene object the effect is applied to.
It’s created via Window → Sequencing → Timeline. Select a GameObject in the scene (a
PlayableDirector + Timeline Asset will be created), and the editor opens.
Tracks
The standard types:
- Animation Track — plays an animation on the bound Animator or Transform.
- Audio Track — plays an AudioClip through an AudioSource.
- Activation Track — enables/disables a GameObject during the given intervals.
- Control Track — controls a nested Timeline, Particle System, or Prefab Instance.
- Signal Track — sends named signals into code (events).
- Cinemachine Track — switching between virtual cameras with blends.
- Playable Track — your custom playables (the advanced case).
Example: opening a door
Scenario: the player walks up → 3 seconds of cutscene → the door turns, a creak sound plays, the camera shows what’s behind the door, then returns to the player.
- In the scene: a GameObject “DoorCutscene” with a PlayableDirector + Timeline Asset.
- In Timeline create tracks:
- Cinemachine Track → switching
MainCam→DoorCam→MainCamwith a 0.5s blend. - Animation Track on the door: drag-and-drop the “Door_Open” clip.
- Audio Track: a clip with the creak effect.
- Signal Track at the end: a “CutsceneFinished” signal.
- Cinemachine Track → switching
- In the scene: a
SignalReceivercomponent handles the signal and calls your code.
using UnityEngine;
using UnityEngine.Playables;
public class DoorOpener : MonoBehaviour
{
[SerializeField] private PlayableDirector director;
private void OnTriggerEnter(Collider other) {
if (other.CompareTag("Player")) {
director.Play();
}
}
// A method bound to the Signal Receiver
public void OnCutsceneFinished() {
// For example, return control to the player, open the door as a Trigger
Debug.Log("Cutscene done — gameplay resumed");
}
}
Signals — the bridge between Timeline and code
Signals are the single most useful thing for linking cutscenes and game logic:
- Create a SignalAsset in the Project (Create → Signal).
- In Timeline, on a Signal Track, add a clip with this signal at the right moment.
- In the scene: on a GameObject add a SignalReceiver component, add a reaction: when the
“PlayHitSound” signal fires, call the
AudioManager.PlayHitmethod.
This lets one and the same Timeline asset send events to different scene objects — the link goes through bindings, not through hard-coded paths.
Without Cinemachine Track you’d have to move the camera by hand via an Animation Track, which is fragile and doesn’t scale. With it you switch between virtual cameras in a single click, and the blend is set in the Timeline itself.
Wrap Mode and pausing time
PlayableDirector has settings:
- Play On Awake — start immediately when the scene launches.
- Wrap Mode —
Hold(freeze on the last frame),Loop,None(disappear). - Update Method —
GameTime(respectsTime.timeScale),UnscaledGameTime,DSPClock(for syncing with audio),Manual.
For important cutscenes people set UnscaledGameTime — so that a pause doesn’t stop the cutscene itself.
The link to Animator
During playback Timeline takes control over the bound object’s Animator (via an override controller under the hood). After it ends, Timeline returns the Animator to its original state. This guarantees that during a cutscene your character won’t “snap” into idle from the state machine.
What usually goes wrong
- Bindings aren’t bound. A Timeline Asset is a template. On each PlayableDirector you need to bind the tracks to specific scene objects. Without that nothing plays.
- Cinemachine Brain in
Manualmode. If the CinemachineBrain is in Manual mode, virtual-camera switches from Timeline won’t work. - A timing mismatch with animations. If your clips are authored for 30 FPS but the Timeline is at 60 FPS — set the Sample Rate accordingly.
- Using Timeline for everything. Timeline is a directing tool, not game logic. Don’t write a quest system with Timeline.
In the next chapter — multiplayer: the basics of Netcode for GameObjects.