Cinemachine: Intelligent Camera Switching Using ClearShot

Ryan McCoach
2 min readAug 23, 2022

--

Intro

A Clear Shot Camera according to Unity’s documentation, “… chooses among its children Virtual Cameras for the best quality shot of the target. Use Clear Shot to set up complex multi-camera coverage of a Scene to guarantee a clear view of the target.”

ClearShot Camera

Using Cinemachine, create a Clear Shot Camera.

This will create a ClearShot with a virtual camera child.

For ClearShot to work the virtual camera needs to be able to Avoid Obstacles which prevents it from moving through objects. This will require an object to Look At.

We can add more virtual cameras and different kinds of virtual camera.

Each type of virtual camera added to the ClearShot list will need to have the Camera Collider extension.

The idea of ClearShot is to have a set of cameras that cover each area of the scene and ClearShot will automatically switch to the camera with the best shot of the target.

The case above there is camera 1 giving an overview of the outdoor area and camera 2 cover the indoor area.

The ClearShot camera will automatically make that switch the camera when the player move outside to inside and vice-a-versa without writing any script. Magic!

--

--