Transposer Virtual Camera Explained in Unity’s Cinemachine
Objective: To understand what the Transposer virtual camera is in Unity’s Cinemachine and how to use it.
Similar to other virtual cameras, the transposer moves in a fixed offset position relative to the ‘Follow’ target (with applied damping), however, the actual fixed offset position can be interpreted differently depending on the ‘Binding Mode’ selected which takes into account either local or world space coordinate systems:
As mentioned above, determines which coordinate space to use so it can interpret the virtual camera offset position relative to the ‘Follow’ target, with damping.
The ‘Binding Mode’ comes with 6 different options and introduces new concepts such as pitch, yaw and roll rotation which can be brilliantly summarized by this simple diagram of an airplane flying:
Pitch, yaw and roll rotate around the X, Y & Z axis’s respectively.
In terms of Cinemachines virtual cameras, the ‘Pitch, Yaw and Roll Damping’ effect determines how responsive the virtual cameras track the ‘Follow’ target rotations around the X, Y and Z angle respectively. Similarly to the standard damping effect, the lower the number, the more responsive the tracking is.
The 6 Binding Modes
It is time to discuss the 6 different bind modes and I will be using some wonderful images from Unity’s website itself to help describe (visually) what is happening with each virtual camera as it can get quite confusing quite quickly.
Lock to Target on Assign
The offset for this virtual camera will remain constant in World space and when the virtual camera is activated or the ‘Follow’ target is assigned, this mode will set the orientation of the virtual camera to match the frame of the target.
This camera WILL NOT rotate when the target does.
Lock to Target with World Up
This mode ignores the targets pitch and roll (by automatically setting them to 0), only allowing the yaw when the target rotates, whilst using the local frame of the target.
Lock to Target, No Roll
The same as Lock to Target (below), except there is no roll.
Lock to Target
This binding mode also uses local frame of the ‘Follow’ target and allows the virtual camera to rotate with the target, keeping the same view when it has rotated on the X, Y and Z axis.
The virtual cameras offset position uses World space that is relative to the origin of the targets position.
This virtual camera WILL NOT change positions when the target rotates.
Simple Follow with World Up
This mode is quite an interesting one that looks to capture or emulate the actions of what would happen if a camera person in real life was following a target. In doing so, it attempts to move as little as possible in terms of distance and height to the target.
It uses local space to calculate the simple offset and damping.
Follow Offset and Damping
Follow offset is the location of the virtual camera when the X, Y & Z axis offsets have been applied.
Damping has been covered here.
How Would We Make Changes at Runtime Through Scripting?
Take a look at this previous article which covers this.