Framing Transposer Virtual Camera Explained in Unity’s Cinemachine
Objective: To understand what the Framing Transposer virtual camera is in Unity’s Cinemachine and how to use it.
What is the Framing Transposer Virtual Camera?
The framing transposer virtual camera uses a fixed screen space relationship with the ‘Follow’ target, whilst also allowing for damping, offsets and compositions rules to help define this relationship.
Unity states that it first moves the virtual camera along the Z-axis, until the ‘Follow’ target is at the desired distance from the camera’s X-Y plane. It then moves the camera in its X-Y plane until the ‘Follow’ target is at the desired point on the camera’s screen.
When you first change the mode to framing transposer, you will notice that it looks like the ‘Aim’ mode which is associated with the ‘LookAt’ target. The framing transposer only uses the ‘Follow’ target.
Framing Transposer Virtual Camera Settings
Tracked Object Offset
This is simply the offset of the virtual camera to the target game object.
Lookahead Time
This setting estimates the motion of the ‘Follow’ target and adjusts the offset accordingly of the virtual camera to try and be ahead of the target. Having a higher number here means Cinemachine will try to predict the motion further ahead in time, putting the camera further ahead of the target.
E.g. This is with a Lookahead Time of 0 (minimum value):
E.g. Lookahead Time of 1 (maximum value):
Lookahead Smoothing
This setting attempts to smooth out any jitteryness caused by the ‘Lookahead Time’.
E.g. If we were to leave the Lookahead Smoothing value at 0, then what we would be seeing is the gif directly above this.
E.g. Now take a look what happens if we were to set this to the maximum value of 30. It’s starts with the target and slowly starts to get ahead of it:
Lookahead Ignore Y
If you were to enable or tick this box, this simply means that it will not take into account the Y axis for the lookahead calculations.
X, Y & Z Damping
Previously discussed here.
Screen X & Y
This is the horizontal and vertical screen positions for the ‘Follow’ target. By default they are set to 0.5 but can be changed to anywhere in the range of -0.5 to 1.5.
E.g. 0.5 on both the horizontal and vertical screen positions gives us this:
E.g. If we were to set the Screen X value to 0.75 it would look like this. Now the virtual camera will try to position the target inside the new screen space:
Camera Distance
This is the distance of the virtual camera that is maintained from the ‘Follow’ target along the cameras axis. This position will also take into account the tracked object offset.
E.g. A camera distance of 0, will place the virtual camera directly in the ‘Follow’ target. Alternatively if I was to set the distance at 5 and 10 (see below):
Dead Zone Width & Height
This setting refers to the white zone that is shown below and means that the camera will not be moved horizontally (x-axis) or vertically (Y-axis) if the ‘Follow’ target is within this range of the position:
E.g. The camera waits until the target is at the edge of dead zone before moving regardless of how big the actual dead zone is:
E.g. Smaller dead zones at 0.25 for both:
Dead Zone Depth
Kind of similar to the above in that the camera won’t move along the Z-axis, but instead of waiting until the ‘Follow’ target is out of range using the white zones, this setting uses a distance and once the target has reached this distance it will move:
E.g. Watch as the camera moves along the X and Y axis until it has reached the distance of 20 along the Z axis:
Unlimited Soft Zone
Enabling or ticking this box means that the soft zone has an unlimited size. You will also lose the editable options below.
Soft Zone Width & Height
When the ‘Follow’ target is within this soft zone range (the blue area), the virtual camera will move horizontally and vertically to frame the target in the dead zone range. This also allows for X, Y & Z axis damping effect.
E.g. The target is in the blue zone and the virtual camera is forced to move to make sure that the target is framed within the dead zone:
E.g. With damping:
Bias X & Y
This settings allows you to move the target position away from the center of the soft zone on the horizontal and vertical axis.
Center on Activate
This has 2 different modes based on whether this is ticked or not. If it is ticked (true), it will force the target to be the center of the screen when the camera is activated/loaded. It if is unticked (false), instead of forcing the target to be the center of the screen, it will clamp the target to the edges of the dead zone (white zone) instead.
How Would We Make Changes at Runtime Through Scripting?
Take a look at this previous article which covers this.