Introduction to Cinemachine in Unity

Objective: Create some virtual cameras in Unity using Cinemachine

Cinemachine is a package that is available for Unity that allows for professional camera setups in Unity with minimal coding.

For this article, I will be going through how to set up a couple of virtual cameras for a project.

First thing, you will need to install Cinemachine into your project. It can be found in the package manager underneath the Unity registry option.

Once it is installed you will now see the option to use Cinemachine along with the usual Unity options.

This is where we will create the virtual cameras from. Click create virtual camera. This will create a virtual camera in the hierarchy.

I have added two cameras and set them up as I want them to look in the scene.

Above you can see the view in the game scene has changed when you click on the virtual camera. To get this shot setup I aligned the virtual camera as I wanted it and then I aligned the game view with the object. You can do this by selecting the virtual camera in the hierarchy and then Gameobject and align with view.

There are a lot of settings in the virtual camera that can be adjusted:

You can try changing the settings and see what effects it has on your camera. You may have also noticed that once you added the virtual camera, there is now an extra component attached to your main camera, and this is the Cinemachine brain. This controls the virtual cameras in Cinemachine.

That is it for setting up your virtual cameras for now. Next time I will go through how to use Cinemachine with Unity’s timeline to create a cutscene using the virtual cameras.

Integration support and part-time game developer