My journey becoming a Unity game developer: Cutscenes-Pan Virtual Cameras
Objective: Animate the virtual cameras using the Pan method.
Start by clicking on the Sleeping Guard Cutscene game object and creating another Animation Track inside Timeline. Drag the CM OTS Shot object under CM Virtual Cameras game object into the Animation Track slot. There should be a message appearing next to the slot signaling that you will need an Animator component added to the CM OTS Shot camera. Select Create Animator on CM OTS Shot to add an Animator component if there isn’t one already on the CM OTS Shot. When you click on CM OTS Shot, you will see an Animator component added to allow for animations to be created for this camera.
Now if we click on the Animation Track REC button, we can modify the position, rotation, and properties of the camera with keyframes added in the Timeline. To set the 1st keyframe, just type in the exact coordinate in the X-position. Before we cut to the next virtual camera is when we want to end our Pan. Move the CM OTS Shot camera just above Darren’s shoulder and zoom-in a little bit to make the scene a little more dramatic.
If you want to see the animation play without the guides onscreen, there is 2 ways to do it. One way is to click on the Sleeping Guard Cutscene object, or go to CM OTS Shot object and inside Cinemachine Virtual Camera component turn off Game Window Guide.
What happens if we press STOP REC, and we wanted to make changes to the keyframes? Since we can’t make any changes to the keyframes in Timeline, we will have to use the Animation Window. Double-click on the Animation Track Timeline to open the Animation Window, and position it on top of the Timeline Window.
If you want to modify the animation’s keyframes, just move the Time Slider to the keyframes you want to adjust and make the new changes. You can also delete the keyframes and make new animations as well.
You can also animate the virtual camera using the Scene View and Align with View setting. In the Scene View, move to Darren’s over-the-shoulder view position that you find acceptable, and press CTRL-SHIFT-F to Align with View. Then move the camera’s position using the X, Y, or Z coordinates to place the camera into the positions to animate.
Using the Pan method with the virtual cameras can make the viewer think something more or is happening in the scene than it really is.