Framework 1: How to make camera Follow the Player

Working with Cinemachine and making it follow the player

Now that we have set up everything from ledge grab to jump and run. We need the camera to follow along the player so it can see everything when the player traverse the scene. For this we are going to use the Cinemachine to track the player movement to allow the seamless pan across the scene.

Installing the Cinemachine:

Go to Window > Package Manager to open up the package manager and assets and locate the Cinemachine plugin.

The current latest version for me is 2.6.10

Once you have installed the latest iteration you should have an new toolbar option on the top of the bar.

Creating the Virtual Camera:

To create the the virtual camera, under the Cinemachine tab, select “Create Virtual Camera. A new CM camera would be created in the Hierarchy. To affix the camera to the player, under the “Follow” slot drag the player game object.

Then under the Body section by default the Transposer should be selected, we are going to change that into the “Framing Transposer”. Automatically on the Scene view, there would be guilds that show up. As long as the player is within those boundaries the camera would try to keep the player on center view.

Turn on Gizmos if the grid does not show.

To adjust the positioning of the target, select the Virtual Camera and position it in a desirable place. The yellow pixel is the target, so as long as the player is within the yellow pixel, the player will be in the center of the camera.

Now when you move, the cinemachine camera would follow the player automatically, all without scripting.