The Great Fleece: Sleeping Guard Cutscene

Lets dig into this first scene. Here we have Darren taking a keycard from the guard that is sleeping at the desk. I’ll walk through how to set up this scene.

All the animations are laid out for us. I’ll be focusing specifically on Cinemachine and Timeline.

First, we need to block the scene. This is just setting up our actors in the scene. So navigate to your project view, and find the “Get_Card_Cutscene” inside the prefabs folder. Now bring that gameobject to the security desk. There will already be a guard sleeping there. Just disable that object for now. Be sure to line up the regular sleeping guard with the new one your putting into place.

If you run the application right now, you’ll see them act out the scene. This was rigged and animated outside of Unity. Cool huh?

Next we need to compose our shot. Taking a look at the directors notes, you’ll see what they want this scene to look like. One camera behind Darren and another in front after grabbing the key card successfully. SO now lets dive into Cinemachine :)

Cinemachine is just a dynamic camera that allows you to create cinematic cutscenes in Unity. To create a cinematic cut, lets create a Virtual Camera. This camera will be used by the main camera to compose our shot.

Navigate to Cinemachine at the top, and select “create virtual camera”. Name it “OTS_Darren_Shot”. This will be our Over-the-shoulder camera. All we have to do is line up the virtual camera with our scene. If you go to your scene view and set up the angle you want, you can just press Control +Shift +F and the OTS camera will snap to that position. Pretty awesome time saver there!

You may be wondering what this camera view is all about. Check out the Aim properties in the inspector.

We are going to go over these controls in a little more depth in the second cut, but the blue and red area can be used as a guide to help with setting up the scenes using the rule of thirds. The Dead Zone is the center of the blue. With the aim properties set a specific way you can have this dead zone follow an object within it. This helps with animating the camera’s movements. Lets animate this first cut.

This is going to be a fairly straight forward animation set up. We’ve done this before in the Space Shooter game. We will be using Timeline for this though. Go to the top and navigate to “Window” then Timeline. It should open up to something like this. I have my interface set up a specific way. You can set yours up however you want. I just find this way to be easiest.

Click create with the high level gameObject “Sleeping_Guard_Cutscene” selected. Save this to a new file called “TimeLine”. To set up the cuts create a Cinemachine Brain to Timeline. Drag the main camera into the Timeline editor. In the Timeline asset, right click, and add Cinemachine Shot Clip. You’ll see it created a box inside the Timeline editor. Drag the virtual camera to the inspector of this newly created Shot Clip. Add another one and include the second virtual camera you made.

Timeline Animation: During preview mode the animations dont play. Lets fix this.

We need an Animation track.

Drag the Sleeping Guard Cutscene actor into the slot. Add the animation clip “Get_Card_Animation” to this. Now it will play during preview mode.

Now we need to animate the cameras. We’ll do this using an Animation track for each one. Go ahead and do that.

To animate the cameras, this works in much the same way as animating anything else. Press record, and move the camera to the desired location. Make sure you have an initial keyframe for the camera to start at. Drag the slider in the preview mode to preview your camera’s animation:

Go to the next camera and do this for it as well. Be sure to refer to the director’s notes on what that camera needs to do.

I set mine up the same way as the first camera. Simply animating the transform of each one. There is a neat way to utilize the “deadzone” of the virtual camera. I’ll show you how:

We are using the Look At property of our virtual cam.

What do you think we are going to do here? Create an empty game object and drag it into this slot!? You betcha!

Doing this you’ll se the camera is panning down to look at it! Drag the yellow dot around in the scene. You’ll see once the dot goes outside of the deadzone the camera follows it. All we are going to do is simply animate this object to move down and then up as Darren grabs the card key.

Your final result should look something like the very first picture in this article. I hope this was fun for you! Keep following along and I’ll be digging in a little deeper with the following cutscenes. Until next time!

Aspiring Unity Developer, Game Audio Designer and Music Composer