Why Virtual Cameras are Amazing

Heathrileyo
2 min readApr 20, 2022

--

Good morning programmers! Today we’re going to be taking a look at virtual cameras and how they work. When you make a camera with Cinemachine it will be called a virtual camera. There are other options under Cinemachine, they basically virtual cameras with fancy other types of utility such as moving on a track.

So if you add a virtual camera, you’ll notice that your main camera is still in your project, so how does that work? Well your virtual cameras will carry information, like who or what to follow, how to move, or just still and different positions. Think of these as placeholders. The position and all that information can be read by the main camera to dynamical switch to those virtual cameras, or to follow a specific guideline of switching.

This saves you having to program all these movements of the main camera, and you just have to adjust the virtual cameras, and swap when needed.

A neat way you can swap virtual cameras is by adding a priority. You can adjust what the current priority is, and if it goes up and matches with a camera you’ve given that higher number, the new camera will take priority. If you have cameras of the same priority you can randomly rotate between them.

Now you’ve heard me mention camera’s moving and looking at things, but how do you do that? They cleverly made it really easy, you can drag and drop right in your inspector!

You can of course also adjust the cameras focal length here. You can get something close and flat, or far and expanded. Useful for very different things!

In our next post we’re going to look at the aiming features of these virtual cameras. See you again soon!

--

--

Heathrileyo

Full time father of two attempts to fill your prescription and become proficient in the world of game dev