This article covers most of the aiming features that come with using a Cinemachine virtual camera.
To get started, let’s take a look at the Follow and Look At functions.
The Follow function uses the target position to move the position of the camera to pursue it, so it will always correspond with the Body. The warning sign here tells us that we need to have a target to follow for the Body to work.
The Look At function changes the rotation of the camera to face the target.
For this reason, the Look At will always be associated with Aim, and we get a similar warning when there is no Look At target assigned.
To demo the Aim functionality, I want some regular movement for the target, so I make a simple animation for the player to move about the screen.
The animator component is assigned to the player capsule.
The animation is a simple moving reposition of the player, taking it in a rough circular movement.
Here you can see the animation in the scene view.
Here it is again in the game view, coming through the virtual camera being used for this article.
With the virtual camera selected in the hierarchy, the target player capsule is assigned to the Look At function by dragging it in from the hierarchy.
Now the camera will continuously rotate towards the player target. The main problem here is that the camera view is undesirable. The camera is using the center of the target as the point to track, which is typically not a good look. This is where the variety of…