How to Make the Camera Follow the Player Using Cinemachine - Unity Game Development Tutorial
In this Unity game development tutorial we're going to look at how we can have the camera follow the player so that they’re always centred in the view. You can either watch the video version below or continue reading for written instructions. OK, we'll start with this scene that has a character we can move around. We created this scene in our post on using the 'Character Controller' , so take a look if you want to know how it was done. At the moment our camera is static, and we are free to move the character completely out of view. We're going to change this so that our camera tracks the character using a feature of Unity called Cinemachine. Cinemachine provides a suite of tools for creating various different camera behaviours without writing any code. Before we can use this feature, we first need to install the package. We'll select Window->Package Manager from the main menu. We'll search for Cinemachine and install this package. Once this is in...