Understanding the LookAt Field in Cinemachine Virtual Cameras
Objective: To understand the LookAt field in Cinemachine Virtual Cameras in Unity.
What is Look At in the CinemachineVirtualCamera Component
The easiest way to define the Look At field is what game object the virtual camera is going to be aiming at. The Aim properties which were discussed in a previous article will use this target to rotate the Unity camera. If there is no target (empty field), then the Unity camera will use the orientation of the virtual camera.
Below I have set the target to be “Darren”, and I have completely removed the dead zones on the camera as seen in the Game window (dead zone has been replaced with a yellow dot in the centre). I have now moved the camera so it is not facing Darren, when I now hit Play, the Unity camera will rotate so that the centre of Darren is the result of the Aim properties:
As mentioned, if I was to leave the Look At field blank, the Unity Cameras orientation would be the same as the virtual cameras and we wouldn’t expect any movement as their is no Look At target to Aim at:
As you can see the animation plays out but the cameras don’t aim to the Look At object.