What are “Look At” and “Body” in Virtual Cameras?
Virtual Cameras in Cinemachine have several features that make them extremely useful assets in our project. If you’ve been following along with my recent articles, you might be familiar with the Aim component, which allows the camera to rotate in the direction of a given object. Today we’ll discuss features that allow us to go a step further and actually have our Virtual Cameras follow an object in motion.
Objective: Learn what the Body property is and how it utilizes the Look At and Follow features to effectively follow objects.
Table of Contents
What is Body?
In our Virtual Cameras, you will find a section named “Body”.
This property is used to specify the algorithm that is used for the Virtual Camera’s movement. So essentially, this behavior modifier changes how the camera follows the objects.
If you click on the drop-down menu, you will see a list of options to choose from.
Note: Since these features are important and more complex to explain, they will get a dedicated article.
Let’s take 3rd Person Follow as an example. This is the famed 3rd person camera view used in video games. This feature comes complete with a myriad of customizables, but this will get its own article later on. For now, we’ll focus on seeing how Body utilizes the Follow slot.
Once you have selected a Body mode, you might get a warning message. This is where the Follow feature comes in. As you can see, the 3rd Person Follow can only work if you’ve previously selected a Follow target.
Follow
Let’s say that a capsule is our player character, which is of course the target for a 3rd Person Camera. To assign the target, we simply drag and drop it into the Inspector.
Now, if you move around, you can see that the Camera is following the object.
Note: Remember that to see the camera view, you need to press the Solo button in the Inspector.
If you want the camera to not only flatly follow the object but also focus on it, you will need to use the Look At feature.
The Look At Feature
I previously discussed the usage of Look At when we explored Aiming Features. To make the camera focus on your object, all you need to do is drop the desired object into the Look At slot.
If you open your Aim settings, you will notice that a small yellow square will appear over your object. This means the camera is now aiming at.
There are several useful things we can do by combining both Look At and Follow, but we’ll be taking a look at those when we dive deeper into the aforementioned dedicated articles!
In Summary:
- Body is a behavior modifier to determine how the camera follows a given object.
- Follow allows you to set a target object which will tell the camera which object to follow around.
- Look At allows you to aim at a specific object in your scene to give it a priority in view.