Setting Up Virtual Cameras — Unity Cinemachine
With Cinemachine installed, let’s take a look at the camera system.
Unity by default has the “Main Camera” Gameobject in every scene. You must have a main camera to use Cinemachine.
More specifically, your main camera needs a new component called the Cineamachine Brain.
Why do you still need a default camera? Because Cinemachine uses virtual cameras, and the main camera is still the port to view the game with.
You can think of the virtual cameras as saved transforms and/or commands that, when trigged, will make the main camera go to that location and proceed with the commands if present.
I created two of these and set them in different locations.
When you look at the Inspector window on the vcams, near the top is the “Solo” button. Pressing this will force the game view window to show the selected camera’s point of view.
The primary method of swapping cameras is by disabling the vcam gameobject. Look what happens when we do this instead:
By default, we get a nice smooth transition to the new location. This transition can be edited or replaced (covered later).
Moving forward, we will look at how to aim the cameras and get those perfect shots!