Changing cameras with animation
Not only can we animate cameras using the Animation View, but we can also change the shots in time.
Getting ready
This recipe will also be created from scratch in Unity. You can download the example Unity project provided and go to Chapter 08 Animating Cutscenes\Recipe 02 Changing cameras with animation directory. You can find a Camera Changer game object in the Example.unity scene there, with three cameras as children. If you play the game, the cameras will change.
How to do it...
To change cameras using animation, follow these steps:
- Create an empty game object in the
SceneView and name itCameraChanger. - Rename the
Main CameratoCamera (1)and copy it two times. You should haveCamera (1),Camera (2), andCamera (3)game objects. - Parent all three cameras to the
CameraChanger. - Place the cameras as you wish.
- Set the
Depthof the cameras in increasing order. Every new shot should have a greaterDepthvalue. - Select the
CameraChangergame object and open theAnimation...