Unity Development — Camera Follow

Here’s a tip for Unity that is going to be quick and easy, but one of the most useful things you’ll see for all your future projects. We’re going to follow our player with a virtual camera.

To get access to virtual cameras, we’re going to need to download Cinemachine from the Package Manager. Open it up with from the Window tab and then find Cinemachine.

Once this is downloaded and installed, you can add a virtual camera to your scene.

This will automatically give your Main Camera a Cinemachine Brain, which takes care of most of the background work, making your Main Camera and the new virtual camera to be one and the same.

On the actual virtual Inspector, there is an attribute called ‘Follow.’ You are going to click and drag your player object into this spot and now the player will be followed. It is as simple as that.

You can play around with some of the other settings, such as dampening and dead zone, but for the most part, that is all there is to it. Your player will now be followed by the camera as they move.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Making Animations Fun Again on iOS

How we built a Reuse Platform and what you can learn from it

TOP TIPS FOR THE CORUSE

AWS re:Invent 2017 Series — The trending topics and closing remark

CSS Frameworks: Making your own

/lang.kah/

HackTheBox-Love

HowTo - Configuring server for hosting single Laravel web - SSL with Let’s Encrypt

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Christopher Graf

Christopher Graf

More from Medium

3rd Person Follow Virtual Camera Explained in Unity’s Cinemachine

Cinematography in Unity — Dolly Tracks

Adding a collectible ammo charge powerup

Reflection Probes in Unity