Working with Cinemachine

How to focus on multiple objects within an virtual Camera

Simon Truong
3 min readJul 8, 2022

--

Now that we are able to work with multiple different types of camera, the most settings that we have encountered was focused on single target objects. But Unity has the ability to focus on multiple targets at once without loosing any of them within the field of view.

Prepping for Group Target:

To test the group targeting system for the virtual camera, we are first going to setup multiple of objects within a scene, for this experiment we are going to have 2 cubes along with our Player.

Next we are going to create an new empty game object. Within this empty game object we are going to attach something called “Cinemachine Target Group”. This is an extension which allows you to group various objects together and allow the virtual camera to treat it as one object.

The list can contain objects and also the Player.

In the target list, we are able to apply as many objects as well want, as long as they are within the list, they will be presented within the field of focus, this includes the Player.

Setting Up the Virtual Camera:

Next we are going to create a new Virtual Camera and set up the “Aim” from Composer to “Group Composer”.

Then we can add the “Target Group” game object as the Aimed object. When we play the scene now, you will notice that all 3 objects in the scene will always be in focus.

If you see that some of the objects are cutting out of the scene focus, there is also an extra setting within the Target Group Component that can be adjusted to fix this issue. With each object within the list, there is an “Radius” setting. This gives each object an invisible border which will center the objects.

The weight adjustment is also directed at which object has more priority than the others. If I were to set the Player to have an weight of 5 and the rest of the objects to 1, then the camera focus would be towards the player more so than the other objects.

--

--

Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.