Switch Between Cameras in Cinemachine- Game Dev Series 172

Objective: quick introduce of easy way to switch cameras.

With creating virtual cameras in Cinemachine, there should be more than one camera in your game scene. The next question would be how to switch these cameras to the one you need during the game?
There are 2 easy ways to solve this problem:

Enable/ disable

One solution of switching the cameras is disable those you do not need in game.

And as you see, camera view would automatically move to the active camera smoothly.

Notice that you might need to set the active camera besides the first virtual camera before using this function in play mode, or you might cause some bug of unable to disable the camera during play mode.

Set priority

Another way to switch between cameras is change the number of priority.
In the Inspector of each virtual camera, there is a section of Priority with base number 10.

Changing this number would set the main camera to the one with highest priority number.

You can use these 2 ways to switch virtual cameras in your game scene.
In the next article, we will use script to control these cameras.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
S.J. Jason Liu

S.J. Jason Liu

99 Followers

A passionate gamer whose goal is to work in video game development.