Project Update: Camera Follow
The new mini update, this time is about the game camera, I decided to use the Cinemachine inside the package manager of Unity.
This tool is phenomenal, it is not the first time I use it but also this time I was amazed by its simplicity.
Just add it from the Package Manager and generate a Virtual Camera to be already halfway through the work.
In my case, I have already chosen to create a 2D Virtual Camera since I’m creating a 2.5D game.
Once generated, the Main Camera of Unity will receive the “Cinemachine Brain” with the reference to the Virtual Camera. Selecting the Virtual Camera and the first thing we are going to do is to set the target of our Camera Follow. In this case the player.
The script of the virtual camera is really very complete and has several parameters that we can change. In my case, I have only modified the Dead Zone to not create a system that was always attached to the player but left some space before following him.
I recommend experimenting with the various settings to find the solution that best suits you.