3rd Person Follow, Orbital, and Tracked Dolly in Cinemachine

Dennisse Pagán Dávila
8 min readDec 15, 2022

--

Time for a more practical example. Previously, we went over the unique Body features in Cinemachine, now we’ll take a look at how I set up some of the coolest Virtual Cameras + Body and Aim settings.

Objective: Learn how 3rd Person Follow, Orbital, Tracked Dolly, and Transposer Body modes can be used to create interesting camera angles and behaviors in a scene. This is a practical example that shows my personal approach to this.

Table of Contents

· 3rd Person Follow
Bonus
· Orbital Transposer
Bonus: Viewing Orbit in Play Mode
Bonus
· Tracked Dolly
Creating a Path
Customizing the Path
Setting Up Camera
Using Auto Dolly

3rd Person Follow

3rd Person Follow is a unique Body setting that allows you to create a 3rd Person camera without having to build everything from scratch.

  1. To add a 3rd Person Follow, we first need to add a virtual camera via Cinemachine.

Note: If you currently don’t have access to Cinemachine, you can follow along with this to make sure you’ve installed it.

2. Next, we need to set our Body to 3rd Person Follow and then assign the Follow, which is the object the virtual camera will follow around. This is ideally your character, it can be a capsule or any random object as long as you get the hang of it. I’ll be using a female character that is, of course, somewhat T-posing for dominance.🤣

The first thing you’ll notice is that the game view, which is currently your camera view, will be set at the character’s feet(or at least where their feet should be if you’re using primitives instead). This is because our default view will always be set to the origin(A).

Source: Unity Docs

That brings us to our next step which is all about setting the camera’s default position.

3. Let’s change the position of our camera to match a real 3rd person view. This setup is very free-form as there are various types of 3rd person views you may want to try, but we’ll go over how to do this together.

The position of a 3rd Person Follow can be determined by the Shoulder Offset.

By using the Shoulder Offset, you are able to set the position of your camera view by manipulating the X, Y, and Z axes.

Personally, I am going for a view similar to God of War 2018, and I’ve achieved this by setting the X and Y axes in the Shoulder Offset.

With this, we already have a pretty neat third-person camera view that will automatically follow the character when moving.

Note: This only adds a follow behavior but you can learn about rotation here.

Bonus:

While we’re here, I want to go over a pretty cool feature which is the Camera Side. If you’ve played third-person shooters like Uncharted, you might be familiar with the concept of shoulder swapping, this is essentially the same and it can be coded to be intractable. I won’t be going over that in this article, but it’s a worthy mention.

In addition to Shoulder Offset, the Vertical Arm Length and Camera Distance can further help us set the camera view.

Vertical Arm Length: This positioning relates to rotation. It ensures that when the camera rotates around the Follow target, it will keep the character's position on the screen by taking arm's length into account.

Note: A more in depth explination is availiable here.

Orbital Transposer

The Orbital Transposer creates a ring around your character or object which allows you to hover or orbit around it the same way you would when moving a third-person camera around your character. In addition to Body features, it makes use of the Aim due to its functionality being rooted in rotation properties.

1. After adding a virtual camera to your scene, make sure you set Body to Orbital Transposer then add your object to both Follow and Look At so that we have access to Body and Aim features.

Once Body is set to Orbital Transposer, a red ring will appear around the Follow object, this indicates the orbital area of the camera.

Note: This is usually set by default, but make sure to set the Aim to Composer.

Bonus: Viewing Orbit in Play Mode

You can see the orbit of the red ring for yourself by going into Play mode. A pretty cool detail about Orbital Transposer is that you can actively see the orbit in play mode without the need for coding, the orbital movement is even smooth with integrated dampening from the get-go.

To observe this, you can tweak the Axis Value in the Body settings while in Play mode.

2. Let’s start customizing the Orbital Transposer. You’ll notice that the position is once again placed at null or origin point, so just like before, we must simply adjust the camera position until we get a good view.

This is done in the Aim by using Tracked Object Offset to set the rotation angle, and in the Body by using Follow Offset to set the camera position.

Tracked Object Offset in Y

Follow Offset in Y

Note: The grid in the game view is the Aim settings markers.

By employing simple settings, we’ve created yet another unique camera type using Cinemachine.

Bonus

There are two additional features that I found to be noteworthy for this article: The Recenter Target Heading and the Value Range.

The Recenter Target Heading will make it so the camera resets its position after rotation when enabled.

Value Range + Wrap will make it so the camera wraps between the given rotational values. If you don’t want the camera to wrap around the player and have a more limited range, this is a value you want to keep your eyes on.

Tracked Dolly

Tracked Dolly is an interesting one as it requires extra steps to use, and it quite literally works like a track dolly. This unique Body setting makes use of an established path composed of waypoints to move or animate the camera along its course. Let’s see this in action.

Creating a Path

  1. Before adding this setting to a virtual camera, we must create the path it will follow. Let’s start by creating an Empty game object and renaming it to Path.

2. Add the Cinemachine Path component to your empty game object. This component will generate a path along with all the options we need to tweak it.

The path should look like this in your scene, kind of like small train tracks.

Customizing the Path

Now, we need to customize this path to give it shape. There are a few things to go over when it comes to this so we’ll take a look at it step-by-step.

  1. Let’s start by discussing waypoints which are the individual segments that make up the path.
  • Adding Waypoints: Simply click on the plus(+) sign then click on the newly added number, this will generate a new waypoint.
  • Moving Waypoints: There are two sets of arrows to move them around, one is for curvature and the other one is for the position. Make sure the desired waypoint is selected in order to move it, it will be highlighted in blue.

Curvature:

Position:

By adding waypoints and adjusting their position you can create your own track.

Note: It is not recommended to make circle shapes because the way Track Dolly works is by calculating the closest point to the character or object then moving in perspective to it. Since all points in a circle are generally at the same distance from its center, this causes the behavior to not work properly.

Setting Up Camera

Now that the path is made, it’s time to set up the camera.

  1. Set the Body to Track Dolly then assign the Look At and Path.

2. Edit the camera angle by using Path Offset which is the camera position relative to the path, and by adjusting the Tracked Object Offset, which is the rotation.

Using Auto Dolly

To automatically track the position of your character, you must enable auto dolly. This option only works when you set a follow target.

Now, whenever I move the character, the camera will automatically follow along the path.

All of this can be scriptable for the best results.

That wraps up today’s article!

I hope you have found this information valuable! Follow me for more Unity Development articles! :) I am a writer on a journey to learn more about Unity Development and Software Engineering.

Check out my LinkedIn and Twitter!

--

--

Dennisse Pagán Dávila
Dennisse Pagán Dávila

Written by Dennisse Pagán Dávila

Software Engineer that specialize in Game Development. Currently looking for new opportunities. Portfolio: dennissepagan.com

No responses yet