Virtual Cameras w/ Cinemachine in Unity 2020 — Part 5

GameDev Dustin
7 min readFeb 26, 2022

--

In this article we’ll dive into the Body (Transposer) settings of our Virtual Camera.

Virtual Camera Body Settings

Body settings are useful for moving the VCam, whereas our Aim settings rotated the VCam.

Body (Transposer) Settings

So these are the available settings and their functions per the Unity Manual for Unity 2020 / Cinemachine 2.8.4.

We’ll go into greater detail and examples throughout this article of each setting.

Body Transposer (Bind Modes)

“The binding mode defines the coordinate space Unity uses to interpret the camera offset from the target and the damping.”

The bind modes will control how the camera reacts to the target game object’s movements in 3D space.

Lock To Target

“Makes the virtual camera use the local frame of the Follow target. When the target rotates, the camera rotates with it to maintain the offset and to maintain the same view of the target.”

Lock To Target No Roll

“Makes the virtual camera use the local frame of the Follow target, with roll set to 0.”

Lock To Target On Assign

“Makes the orientation of the virtual camera match the local frame of the Follow target, at the moment when the virtual camera is activated or when the target is assigned.

This offset remains constant in world space. The camera does not rotate along with the target.”

Lock To Target With World Up

“Makes the virtual camera use the local frame of the Follow target with tilt and roll set to 0.

This binding mode ignores all target rotations except yaw.”

World Space

“The offset is interpreted in world space relative to the origin of the Follow target.

The camera will not change position when the target rotates.”

Simple Follow With World Up

Simple follow with world up interprets the offset and damping values in camera-local space.

This mode emulates the action a human camera operator would take when instructed to follow a target.

The camera attempts to move as little as possible to maintain the same distance from the target; the direction of the camera with regard to the target does not matter.

Regardless of the orientation of the target, the camera tries to preserve the same distance and height from it.

Continuing on with the same project from previous articles, I’m going to take my second VCam, which I will refer to as VCam2 though it is named CM vcam1 (1), and reposition it.

I want my VCam 2 to follow a target, not aim at a target so I’ve positioned it accordingly.

Remember to use the “Align with View” method to reposition your VCams easily.

I’ve also added some more background game objects to the scene to make the relative movement clearer in the game view.

So, first we need to assign our Target game object to the follow field on our VCam 2.

As you can see, I hit the number 2 on my keyboard and the camera switches to our new follow VCam.

In the scene view, you can clearly see that VCam 2 does not just rotate around to follow the game object from a stationary position, but rather actually moves with the target game object.

This is the key difference between a Follow target and a Look At target on a VCam.

This is something you would use for a first or third-person player camera.

Now, I haven’t played with any of the Body settings, so this should be a pretty default behavior.

Modifying the Target Animation

Some of these settings won’t be noticeable unless our target game object rotates, so I’ve modified the target game object’s animation to look down while moving and then turn side to side.

Note that with this default behavior, looking side to side loses track of the target game object now.

If we set our target game object as our Follow AND our Look At, we can avoid this behavior.

That’s much better.

Combining our Follow and Look At abilities and various settings makes our VCam so much more powerful!

Now, some of my aim settings are from previous articles with extremes to them, so I’ve modified them as shown above.

This gives a much more pleasant camera view effect.

Binding Mode Demos

I’m going to record a gif of how each of the binding modes works in relation to our project with default associated settings.

We are already using Lock To Target With World Up, so we’ll skip that one.

Lock To Target On Assign

Lock To Target No Roll

Lock To Target

World Space

Simple Follow With World Up

Wow, does this one not like having the target assigned to both the Follow and Look At fields!

All of the examples above have been with Target1 game object assigned to both Follow and Look At fields, so let’s go through them again with just the Follow field assigned to see the differences.

Something else to note is that with the X, Y, Z damping at their default 1 values, I experienced issues with my current setup for the scene.

The scene loads with VCam 1, and then I switch it to the VCam 2 whose settings we are playing with.

With these damp settings on 1, switching between the cameras caused weird offsets depending on what part of the animation the target game object was in.

Turning them all down to 0 resolved this issue.

Lock To Target On Assign — Follow Only

Lock To Target No Roll — Follow Only

Lock To Target — Follow Only

World Space– Follow Only

Simple Follow With World Up– Follow Only

I’m truly beginning to hate Simple Follow With World Up.

It seems to always jack up the camera positioning.

I think this is probably only useful if you won’t be switching between VCams to it.

Additional Thoughts

Now, I’ve set all of these up with the camera in a close follow behind of the target game object.
This makes some of these Binding Modes more or less useful.

You may find a particular follow Binding Mode for a camera at a much farther distance from the target game object achieves a desirable result for you.

We’ll continue working on our VCams with Follow target game objects in the next article.

--

--