Now we’re getting somewhere — animating and creating cuts in cutscenes with Timeline in Unity
In my previous article, I discussed how to compose a shot. In this article I will continue with the cutscene I was creating based on the director notes and will animate our camera transitions.
The first thing we will do is add a playable director to our cutscene container game object. This gives us a Timeline asset to work with.
As we are working with Cinemachine we need to add a Cinemachine brain to the timeline. The easiest way is to just drag the main camera into the Timeline editor and select “Add Cinemachine Track” from the menu. This allows us to switch between virtual cameras.
Now we can add our shots along with their lengths. Right-click on the timeline section of the window and select “Add Cinemachine shot” or you can just drag in the virtual camera you want to use. We can adjust the length by dragging the edges of the Cinemachine shot in the timeline.
We can now do the same for our other shots. If we click the play button we can preview our shots.
Now the cuts look too instant and choppy. We can fix this by blending shots. If we drag one shot into another we can create a blend. The more the objects interact the longer the blend.
The cuts don’t mean a lot to us if we can't see the animation that goes with them. So let's fix this by adding an animation track to our timeline as well. We can drag our object that has the animation controller into our timeline tracks and click the pop-up “Add Animation Track”.
Now this track is added, click on the menu button and select “Add From Animation Clip”. This brings up a menu full of our animations, and the correct animation and then adjust your shots if required.
Now, if we click play we can see the animation and the shots working together.
The last step we can take is to animate the virtual camera to create a panning effect. We do this by creating another animation track and dragging the virtual camera into it. This will automatically create an animator on the camera.
From here hit the record button and record the panning effect, this functions very similar to the animator as it records keyframes for the movement of the camera, remembering the first keyframe needs to be added first (do this by changing the camera transform values then change them back).
Now we see the end result.
That's all for now.