Nerd For Tech
Published in

Nerd For Tech

Creating our scenes with Virtual Cameras

When we create a cutscene in Unity, there are 2 parts, timeline and Cinemachine. Timeline is an animation track that is a sequence of events. You can place the events of the cutscene into this track, be it the animations, sounds and manipulation of the cameras. Cinemachine is the camera, or the director of the scene. You can create a dynamic camera system with virtual cameras to create cinematic shots. It works with timeline, in which timeline allows you to blend those shots together.
For this, we will creating a guide as to what we plan to do with a sleeping guard scene and how we would go about to make it. The scene, as illustrated by a sketch of the directors vision is like so:

To start with this cinematic, we first need to place in our “actors” to the scene:

With this in place, we can see how the animation looks, just for curiosities sake:

Now that we see the cutscene in action, we now have to figure out how to set up our different camera angles along with activating our actors when we want this animation to be played, then hiding them again once the cutscene is finished.

First of all, with our actors in position, we will now create a virtual camera to work with and get it in the position of the first cut in our directors vision:

From here, we want to move our virtual camera to something similar to the directors idea. With Unity, we can easily do that by clicking on the camera and having it align with the current view:

With our initial shot in view, we can now make some small adjustments to make it appear more appealing. A general rule used throughout the film industry is something called the rule of thirds. What this rule implies is that you would divide a frame into 9 equal parts and place your main object within the intersecting lines of this frame:

Here we have our sleeping guard and player both at the edges of our central “dead zone” This dead zone is and area where the camera will not move as long as what is looking at with targeting until it moves.
Next, we are going to create our second angle of the cinematic, which is the front view seeing our player take the card from the guard:

Again, following the rule of thirds, we have our main target, the keycard, at the edge of our dead zone with our player on the other side.
With this in place, if we try to go back to our initial shot, we end up having the same point of view as the shot we just created:

To be able to switch back to the view of the first camera we created, there are a couple methods we can take. When we select our initial camera and move over to the inspector, we can click the “solo” button to have it switch to that view, or change the order in which we want the camera to be in. The higher the number, the more important it is, meaning it will be the first to appear.

When we create these virtual cameras, on the main camera a new component is created:

This cinemachine brain component allows us to switch between virtual cameras and take the camera’s position and rotation to the location of the virtual camera.
Finally, we will clean up our hierarchy a little bit so that we don’t get it too overcrowded with objects and can easily locate something when it pertains to a specific part we are looking for:

Now that we have set up our scenes, we can look towards using timeline to create our cuts and give our standing actors a little bit of life.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store