How to do it...

To change cameras using animation, follow these steps:

  1. Create an empty game object in the Scene View and name it CameraChanger.
  2. Rename the Main Camera to Camera (1) and copy it two times. You should have Camera (1)Camera (2), and Camera (3) game objects.
  3. Parent all three cameras to the CameraChanger.
  4. Place the cameras as you wish.
  5. Set the Depth of the cameras in increasing order. Every new shot should have a greater Depth value.
  6. Select the CameraChanger game object and open the Animation View.
  7. Create a new Animation Clip and call it CameraChange.
  8. Make sure the record button is pressed.
  9. Select all cameras and disable their game objects. Then select the first camera and enable its game object. New keys should be created in the first frame of the animation. The first camera should be active and the remaining two should be inactive (you can check this by clicking on a key). You may need to set the cameras to active to create the keys and then set them to inactive (Unity sometimes doesn't create a key if you deactivate an object and only creates the key if you click to enable it):
Keys containing cameras' state (active/inactive)
  1. Adjust the timeline and activate the second camera. You don't need to deactivate the first one, but you should have only one Audio Listener component enabled.
  2. Adjust the timeline again and activate the third camera.
  3. Close the Animation View.
  4. Play the animation or run the game to see the effect.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.188.138