Skip to main content
‹ Back to Tutorials
Intermediate Unity

Unity 3D and Playmaker - Setting up Camera to Follow Player Movement with Smooth Look At Action

Apr 22, 2021
About this tutorial

In this tutorial, I'll show setting up the Smooth Look At action to allow the Main Camera to follow the player movement on the puzzle board. Also check out How to Make a Bounce Game Series https://bit.ly/39HIYBU. //TIMESTAMPS 0:00 Introduction 1:11 Adding Smooth Look At action 1:43 Adding Player

Written Guide

With character movement already working and constrained to the play board, the next problem is what happens when the board grows larger than the screen. Playmaker's Smooth Look At action solves it with one action and two settings — the camera tracks the player wherever they go.

Step 1 — Add an FSM to the camera Select the main camera and add an FSM. Name it Look At Player. Putting the camera behavior on the camera rather than on the player keeps the responsibility where it belongs: the camera decides what it's watching, and the player doesn't need to know a camera exists.

Step 2 — Add the Smooth Look At action Search the action browser for "look at" and add Smooth Look At to the state. Set the game object to Owner, which is the camera holding the FSM. For the Target Object, drag your character in. That's the basic setup, and pressing play confirms the camera is tracking — though not yet framing things well.

Step 3 — Uncheck Keep Vertical On the first test, the play board sits too low in frame and the camera won't tilt down to follow. The cause is the Keep Vertical option, which locks the camera's vertical angle and only allows it to rotate horizontally. Uncheck it and the camera is free to angle downward, which immediately brings the character much closer to the center of the screen.

Step 4 — Offset the target position With vertical tracking enabled, the character now sits slightly too high in frame. The fix is Target Position, which offsets the point the camera aims at relative to the actual target. Uncheck the variable option on Target Position so you can enter raw X, Y, and Z values. Raising the Y value aims the camera higher than the character, which pushes the character lower in the frame — the offset moves the aim point, not the character.

Step 5 — Dial it in while playing The efficient way to find the right value is to enter play mode and adjust the Y field live, watching the framing change in real time. Something around a two-thirds to one-third split reads well; 3.26 is where it landed here.

Step 6 — Don't lose your value This is the part that trips people up. Changes made during play mode are discarded when you stop — the field reverts to its previous value. Note the number you settled on before exiting play mode, then stop, uncheck the variable option again, and type the value in. Test once more to confirm it holds.

Why this approach works Smooth Look At handles rotation only; it doesn't move the camera's position. For a board-game-style layout where the camera sits at a fixed vantage point and the action happens within a bounded area, rotation alone is enough and it's considerably simpler than a follow rig. The setup shown here is framed for a mobile aspect ratio, but nothing about it is mobile-specific — the same FSM works for desktop or console, with the target position offset retuned for the aspect ratio you're targeting.

Unity tools by Bliz Studio
Built for our own games — now on the Asset Store

Multi Tag — unlimited hierarchical tags for any GameObject. Hierarchy Pro — style your whole hierarchy with rules. Made by a Unity dev, for Unity devs.

Explore our Unity assets →