Ok let’s start using the Virtual Camera in our project.
We focus on LookAt and Aim.
This is how things work :
Follow goes to Body
LookAt goes to Aim
This means when we use LookAt, every “feature” about it that we have are inside Aim.
To test it, we create an animation for our Cube and I called it Cube_Movement
and add it to the Cube
Then we open the Animation Tab, and simply set four different position in like four or five seconds.
Now we have simple movement in a sort of circle.
After that, we simply drag and drop the cube inside the Virtual Camera
As we can see, now we have a “focus” inside Game Scene on our Cube
If we press Play now, we see that the Camera, without any type of scripting, follows the Cube.
Let’s look to the Aim section :
First of all, at the moment we are on Composer, if we click it we see other type of Aim. But for now we focus on Composer.
Track Object Offset is useful if we need an offset
LookaHead Time is pretty useful : virtual camera create a sort of “predictable movement” so it not only follow the Cube, but it moves with anticipation to predict the position.
LookaHead Smoothing is referred to LookaHead Time, and simply make that movement smooth.
A great feature is Save In-Game and it does exactly what you think, save the values even if we are in Play Mode.
Lookahead Ignore Y is for “top / down” games, it is particularly useful in situations where we have the camera looking directly down, and with Y we determine which is up and which is down, and since we look down something can break it. With this toogle we can solve the problem.
In the next article we continue with Damping.