Day 28: Creating cutscenes in unity with Cinemachine and Timeline

Philip Johnson
4 min readSep 24, 2021

Objective: To utilize Unity’s robust Cinemachine camera system along with Unity’s sequencing system called Timeline.

To use Unity’s powerful cutscene and camera system, we need to make sure that we import Cinemachine and Timeline into a project. I imported “The Great Fleece” project from the unity asset store and package manager. This project came with Cinemachine and Timeline already installed and this project also provides resources to help us learn this system.

Timeline is Unity’s sequencing system which enables designers and cinematographers to lend their hand in the development process. Cinemachine is a very useful and robust camera system.

To start we will create a Timeline asset. You open timeline by going to window > Sequencing > Timeline. This will open the Timeline sequencer which we will use to animate our cutscene.

We also want to bring into the scene as many Cinemachine virtual cameras that we will need to set up our shots. These virtual cameras function as shots that our main camera will use to position itself for each shot. That includes an animated shot as well. When we imported cinemachine into our project we should have access to the Cinemachine drawer at the top of Unity’s UI.

With the assets we need in place, we can compose our shots and animate our cutscene in Timeline. I also have my cutscenes organized in such a way that makes the project hierarchy easy to comprehend and manage. My cutscene actors (which are highlighted as prefabs) are children to a gameobject called Guard Cutscene. When using Timeline to animate your cutscene you will need to select the cutscene object (in this case its Guard Cutscene) and generate a Timeline readable file. I saved mine inside of a folder called Timeline.

Generating a timeline file will create a file with a film strip icon. to represent our work in Timeline
After clicking on the Guard Cutscene object and generating a Timeline readable file, you’ll be presented with an animation timeline as seen in the image.

Referencing the screen shot above from top to bottom. The Red object represents a Cinemachine Track. This track allows us to create cuts between our different cameras in our cutscene. Cuts can even be blended together to animate the camera with a transmission. The Blue objects belong to an Animation Track, which represent objects that have animation through animation controllers. You’ll notice the two cutscene cameras have animation tracks. The Green object is called an Activation track. With this type of track we can activate or deactivate any object in the scene.

The fade in and out of black effect is controlled by an animation track that controls the animator of a UI image. This is important because we simply animate the alpha of this black image using the timeline.

The control buttons on the timeline track will help us scrub through the entire cutscene sequence without having to run the game and testing our cutscenes during gameplay.

It’s important to know that cutscenes work on activation during gameplay. Meaning that if this cutscene object is active during gameplay, it will grab control of the main camera and play out the sequence we previously animated.

With Cinemachine virtual cameras its important to remember to either Solo the camera when composing shots or to set the priority value to be the highest of any camera in the cutscene. This allows us to compose our shots effectively, and one great way to position your shots is

Now this is just a basic run down of creating a cutscene. In the next article we will tie all of our cutscenes into the real time gameplay. The effect of the Sleeping Guard Cutscene came out as a 5 second animation and the result can be seen in the .gif at the top of this article.

--

--