An Introduction to Timeline in Unity

Calum Slee
3 min readAug 11, 2021

Timeline is a feature in Unity that allows us to create sequential content, generally around cinematic events.

In our current project, we want to create a cutscene with the playable character taking a keycard from a sleeping guard. With all the Game Objects as a child of an empty Game Object, we can create a Timeline component to manipulate different aspects. In our game, this Game Object containing everything will become active when we enter a trigger, this will then set the Timeline in action, running through the sequence of events we create.

The Game Objects in this example are as follows:

Actors: Made up of Darren (the main character), a sleeping guard, and an empty object for one of our cameras to follow.

Virtual Cameras: Two different Cinemachine cameras capturing different angled shots.

Canvas: Contains an overlay to fade in to the shot from a black screen.

On our Cutscene Game Object, you can also see a Playable Director component. As mentioned earlier, this object will be enabled at a point in the game, so we can simply enable Play On Awake for the Timeline.

Within the Timeline window, we can manipulate various things. To start with, let’s take our Cinemachine brain, which is enabled on the Main Camera, and use it to control a Cinemachine track within Timeline. Now, we can add in our two camera shots, and lay them out in the order we would like our cutscene to pan out.

Our character, Darren, also has an animation already rigged that we need to play. To do so, we can add an Animation Track and drag the appropriate animation in. With the two tracks next to each other, we can very easily change when our Camera shot changes, to suit the animation.

Next, we can look at giving movement to our two cameras. To do so, we can drag and drop the Camera objects into the Timeline, and select Add Animation Track. Now we can hit the record button, move the Playhead to the appropriate End Time, then set the Camera position to an appropriate final position. Timeline will capture these points as Dopesheet Keys we can continue to manipulate in the Animation window if we need to.

Note the Mid Shot, is actually animating the Empty Game Object we created for the Camera to follow.

We can also Animate the Canvas object’s Alpha value to create a Fade In from black.

Lastly, we can use an Activation track to enable and disable Game Objects throughout the cutscene. We can do this to make the Keycard disappear from the Guard’s belt when Darren appears to grab it.

Timeline allows us to easily set a series of events all in one location, making for easy manipulation on the fly. With that, our first Cutscene has now been created!

--

--