Camera Pan using Look at

How to make the camera follow an animated empty gameobject

In this article we will use another way to pan the virtual camera. We will use the ‘Look at’ property of our virtual camera to look at an empty game object. Then we will animate the empty game object.

Create Empty GameObject for the Virtual Camera to follow

1 Create Empty GameObject
1.1 Drag the object into the Actors in Hierarchy
1.2 Drag the object into the Look at property of the virtual camera

Look at Empty GameObject and the Dead Zone

2.1 Select virtual camera with the filled look at
2.2 Lock the Inspector
2.3 Select empty game object and move it around

The yellow square is the target that the camera follows. If it hits the edges of the dead zone the camera starts moving. The dead zone can be adjust from the Inspector of the virtual camera under Aim.

Animate the Virtual Camera Look At Target

We are going to animate an object so we need another animation track.

3.1 Timeline (panel) > Add > Animation Track > Drag the camera target into the box > Create Animator Component

3.2 Hit the record button on the animation track to start recording

Here it may be convenient to select the virtual camera again and lock the inspector so you can see the deadzone.

Less Robot Camera

Currently the camera movement is very mechanical.

Let’s add some damping for when our camera follow target leaves the deadzone.
Virtual Camera > Inspector > Aim > Horizontal and Vertical Damping

After Damping

(Another way to smooth things out you can adjust the animation curves)

--

--

--

Aspiring developer that’s self-learning Unity & C# to transition to a career with Unity. I got a passion for creating interactive experiences.

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

Recommended from Medium

An easy explanation of Java Memory Model

Supernotes: Fast note-taking and knowledge sharing

Two imagine firm avoid lot.

UNICOIN AMA Recap with Solishe_kat -------CMO

Encrypting Your File Made Easy With GPG

A Visual Designer’s 100 Framer Challenge [002]

How to Specify Non-PyPI Requirements in Your ‘requirements.txt’ File

How Can I Integrate Remote Configuration of AppGallery Connect in Cordova?

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
Tristan Engel

Tristan Engel

Aspiring developer that’s self-learning Unity & C# to transition to a career with Unity. I got a passion for creating interactive experiences.

More from Medium

Linux loop and function

Bulk Update Multiple WebLogic WLSDM Settings via WL-OPC

Matrix Requirements statement on log4shell scare

OCI Load Balancer — Part-II