Unity Timeline

Unity Timeline is a feature that allows for the creation of cinematic content, gameplay sequences, and complex interactions within Unity. It provides a visual interface to choreograph objects, animations, audio, and events in a linear timeline format, offering an editable sequence of events that can be adjusted over time. By using Timeline, developers can easily create cutscenes, in-game scripts, and other multimedia elements without extensive coding, enabling both artists and developers to collaborate effectively.

Creating a Timeline

Setting up the Timeline

Open Timeline panel via Window > Sequencing > Timeline.

This panel might open beside your scene/game view. I recommend dragging it to the bottom beside the console tab.

Animating objects

This panel work in a similar way to the animation panel, creating clips for selected objects in the scene. For this create a new empty object via GameObject > Create Empty.

Position the new empty object at world origin (0,0,0) and rename it 'Timeline Sequence'

Select the 'Timeline Sequence' object, then click create in the Timeline panel to create a new clip. name this animation clips (eg. Cut scene walk) and save it.

The Timeline tab will change, and start empty. Animation tracks will need to be added for the objects we want to animate. Check the inspector of the 'Timeline Sequence' object to see the Playable Director component. Options can be configured here, such as Play on awake, Looping and initial time as needed.

Keyframes and clips

Adding animation tracks

Click icon in the top left of the Timeline panel, select "Add Animation Track" for the object you want to animate - in this case it is our character.

Drag and drop the object you want to animate into the new animation track slot. Object you intend to animate in this way will need an animator component. If there is not one already, it will be created automatically.

Applying animations

Find the idle animation clip for your character in the Project window, drag and drop this clip onto our timeline and adjust as necessary. I recommend moving the Project panel beside the Timeline panel so you can see and access both easily.

We then want to add a second animation for this object. Find the walk animation for your character via the project window. Drag this clip onto the timeline and see the clips working as blocks that can be reduced, extended and blended.

Extending the clip may HOLD by default, to fix this simply change the loop settings of the clip via the clip options in the inspector.

Blending animations

Pressing play in the Timeline panel will play those clips, but you may notice a slight jump in position which will need blending. Select the walking animation block and drag it left, crossing over with the idle animation to create a blend.

This will create a transition zone as idle changes to walk forward. Check and retime this blend as necessary, be dragging the walking clip left or right.

Working with multiple objects

Override tracks

In order to control the direction and distance our character walks, we can add overrides. To do this click on the 3 dots for options on the animation track. From these options select Add Override Track.

The new override track will appear below, named Override 0. As this suggests, you can have multiple override tracks.

Recording keyframes

The override track needs use to record keyframes, much like the standard animation clips. Ensure your time slider is at 0, the start of the timeline, and the press . This will now record any changes we make to the object, in this case the character.

Move the character a little to drop a keyframe, and then reset the position to 0,0,0. A keyframe will show on the override track, and as with previous animation clips we have made, intermpolate between keyframes.

Move to the transition zone of your clips and move the character forward slightly, this drops another key, moving the character forward a fraction. The ensure the character remains in place for the length of our idle clip.

Now move to the end of your walking clip with the time slider, and move the character forwards to drop a third keyframe. The object will interpolate moving smoothly from one position to the next.

Converting to clip track

While you have some access to the keyframes via the graph icon is can be a bit tricky to use this to re-time the animation. It's easier to work with this like the other clips by converting this data to a clip. To do this, right click on the override track and choose Convert To Clip Track.

This will bake the data to a clip, which can easily be dragged around as required, easily retiming the clip, whilst also giving you the ability to edit the Animation clip directly in the regular animator window. while this is not an essential step, it can provide you with more control.

Working with cameras

Animating the camera

As with any cinematic, you may want to animate the camera movements and change shots. Add a new Animation track to your Timeline, and drag and drop the main camera to this track. It will ask if you would like to create an animator for the object, accept this.

Creating keyframes

once again, make sure your playhead is set to the start of the timeline, and hit the record button. Using the scene view, move around to get a good view of your character. Once you are happy with the view, select the Main camera object and go to GameObject > Align with View.

This will move you camera to mach your scene view, and drop a keyframe on your animation track. I will keep the camera in this position for the duration of the idle animation, to do this easily i will move to that time in the clip, and add a key to position and rotation by right clicking.

I continue moving my scene view, selecting the main camera and aligning with view. I also manually move the camera for subtle movements or rotations - although your scene view will not show the final camera view. Preview your Timeline cinematic by previewing the game

Last updated