Setting up Virtual Cameras

In Unity and Cinemachine

The fundamental elements of Cinemachine, are the various types of Virtual Cameras.

Despite the name, Virtual Cameras aren’t actually a Camera. Instead, it is simply a component used to feed information to a scene’s main Camera, essentially a camera controller. The main benefit, is that we can have numerous Virtual Cameras setup in our scene, but none of them handle any rendering, allowing for better performance compared to using multiple Unity Cameras.

The key drawcard of Virtual Cameras though, is the ability to dynamically track various game objects in our scene, animating the Transform variables. When a Virtual Camera is activated, the Unity camera will follow the position and rotation, including any tracking animations.

Adding a Virtual Camera to our scene, automatically adds a Cinemachine Brain component to the Unity camera. This allows for our Virtual Cameras to be appropriately selected, based on the use of user-created game logic.

In our scene, the Virtual Camera has a similar appearance to the Unity camera. This is because each instance can handle it’s own Lens variables, allowing for the potential use of replicating different real life cameras depending on what’s being shot.

The way we dynamically track objects is done via the Follow and Look At components, with each having their own array of settings through Body and Aim respectively.

As these articles continue, we will begin looking at the various ways we can harness the full power of Virtual Cameras to track game objects in our scene.

--

--

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