Unity and Cinemachine — The Transposer Body Option
Looking deeper at the Transposer option
Last time, we took a whirlwind tour of Cinemachine virtual camera options for when our virtual cameras are set to Follow something. This time, let’s look a little deeper at the Transposer.
As we learned in the previous article, the Transposer option moves the virtual camera in a fixed offset to the followed target. What does this mean? It means the virtual camera will always be locked to a certain, specified distance from its target.
That said, this can manifest in a few different ways, depending on the virtual camera’s Binding Mode.
The Follow Offset fields are the cornerstone of the Transposer Body option, and every other option determines how the Follow Offset is presented.
As stated above, the Follow Offset is simply the distance from the target that the virtual camera remains at.
Here are the options available for Binding Mode.
- Lock To Target On Assign: Makes the orientation of the virtual camera match the local frame of the target from the point where the virtual camera is activated or when the target is assigned. If the target rotates, the virtual camera will not rotate with it.
- Lock To Target With World Up: Makes the virtual camera use the local frame of the target, with tilt and roll set to zero. The virtual camera will only match the yaw of the target.
- Lock To Target No Roll: Makes the virtual camera use the local frame of the target, this time with only the roll set to zero.
- Lock To Target: Makes the virtual camera use the local frame of the target. When the target rotates, the virtual camera will rotate with it to maintain the offset and view of the target.
- World Space: The offset uses world space relative to the origin of the target. Target rotation will not affect the virtual camera’s position.
- Simple Follow With World Up: The offset is interpreted in the virtual camera’s local space. It is meant to emulate how a real-world camera operator would follow a target. The virtual camera will attempt to move as little as possible while maintaining the distance from target.
Finally, depending on which Binding Mode is selected, we will see some selection of Damping options. Damping represents how responsive the virtual camera is to maintaining its position or rotation relative to the target when it is moving. A low value in a damping field represents a rapid response in matching the movements of the target.
Unity Cinemachine provides a separate damping field for every value that can possibly change, which depends on the Binding Mode of the virtual camera.
Look At What You Follow
Something to keep in mind when using the Transposer option is that the virtual camera isn’t necessarily going to be pointed in the direction you want it to simply from following a target.
For example, if you set a virtual camera to follow a target and then use the Lock To Target Binding Mode, you will notice that the virtual camera stays in its proper position relative to the target but it never rotates.
So say you have a virtual camera positioned behind a target facing a certain direction. As long as the target continues facing that direction, there’s no problem. If the target changes its direction, however, you’ll notice that the virtual camera is still behind the target, but it will continue facing the same direction it had.
The point of all this is to express that, depending on what we’re attempting to accomplish, we may actually wish to combine using the Follow field with the Look At field. Using the example above again, by both following and looking at the target, we can have a virtual camera that follows the target and keeps it in view at the same time.
That covers the Transposer option for following targets. Next time, we’ll look at the 3rd Person Follow option. Until then, thanks for reading.