Day 118: Camera Follow System in Unity
Objective: Get the camera to follow the player.
To get started, we will go to package manager and import Cinemachine.
Now that it is imported, we will create a virtual camera. Go to Cinemachine → Create Virtual Camera.
In our Hierarchy we have a CM vcam1. I renamed it to CM Follow Cam.
In the Follow cam we will set the follow and look at, to the player.
With just that, the camera will automattically follow the player around. Below there are more options below that can be adjusted. If you want the camera to only move based of how far to the right or left you are, play with the Dead Zone options.
If you have Game Window guides check, your game window will have red and blue layover on it. This is the dead zone. As soon as the player touches blue, the camera will slowly catch up but if it’s read it will snap to the player quicker.
This is a quick one on getting the camera to follow the player. Thank you for reading and have a wonderful day!