Orbital Follow
This CinemachineCamera Position Control behavior moves the Unity camera in a variable relationship to the CinemachineCamera’s Tracking Target. If you add a Cinemachine Input Axis Controller behavior, the camera position can be driven by player input, which allows the player to dynamically control the position of the camera relative to the target.
Orbital Follow operates in 2 modes:
- Sphere: In this mode, the camera is positioned at any point on a sphere surrounding the target.
- ThreeRig: In this mode, the camera is positioned anywhere on a surface created by extruding a spline - defined by 3 circular orbits - around the target.
The exact position of the camera on the surface is determined by 3 axis values in the Orbital Follow component: horizontal, vertical, and radius. Radius controls the scale, allowing the camera to move towards or away from the target. You can control these values from a custom script, or with an Animator, or by other means that you may devise.
If you attach an input controller to the CinemachineCamera, then the player can control the position of the camera on the defined surface using Unity's input controls. This allows the player to move the camera to any spot on the orbit surface around the target.
Properties
Property | Function | |
---|---|---|
Target Offset | Offset from the target object's center in target-local space. Use this to fine-tune the orbit position when the desired focus of the orbit is not the tracked object's center. | |
Binding Mode | The coordinate space to use to interpret the offset from the target. | |
Lock To Target On Assign | Makes the orientation of the CinemachineCamera match the local frame of the Tracking target, at the moment when the CinemachineCamera is activated or when the target is assigned. This offset remains constant in world space. The camera doesn't rotate along with the target. | |
Lock To Target With World Up | Makes the CinemachineCamera use the local frame of the Tracking target with tilt and roll set to 0. This binding mode ignores all target rotations except yaw. | |
Lock To Target No Roll | Makes the CinemachineCamera use the local frame of the Tracking target, with roll set to 0. | |
Lock To Target | Makes the CinemachineCamera use the local frame of the Tracking target. When the target rotates, the camera moves with it to maintain the offset and to maintain the same view of the target. | |
World Space | The offset is interpreted in world space relative to the origin of the Tracking target. The camera will not change position when the target rotates. | |
Lazy Follow | Lazy Follow interprets the offset and damping values in camera-local space. This mode emulates the action a human camera operator would take when instructed to track 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 respect 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. | |
Position Damping | How responsively the camera tries to maintain the offset in the x, y, and z axes. Small numbers make the camera more responsive. Larger numbers make the camera respond more slowly. | |
Angular Damping Mode | Can be Euler or Quaternion. In Euler mode, individual values can be set for Pitch, Roll, and Yaw damping, but gimbal lock may become an issue. In Quaternion mode, only a single value is used, but it is impervious to gimbal lock. | |
Rotation Damping | How responsively the camera tracks the target's pitch, yaw, and roll, when in Euler angular damping mode. Small numbers make the camera more responsive. Larger numbers make the camera respond more slowly. | |
Quaternion Damping | How responsively the camera tracks the target's rotation, when in Quaternion Angular Damping Mode. | |
Orbit Style | Controls what kind of orbit surface is used | |
Sphere | The camera is positioned at any point on a sphere surrounding the target | |
ThreeRing | The camera is positioned anywhere on a surface created by extruding a spline - defined by 3 circular orbits - around the target | |
Radius | In Sphere mode, this defines the radius of the surface sphere | |
Top, Center, Bottom | In ThreeRing mode, these define the height and radius of the 3 orbit rings that are used to create the orbit surface. These values are relative to the target's origin. | |
Spline Curvature | In ThreeRing mode, this defines the tautness of the line that connects the 3 orbits. This line determines the final shape of the surface. | |
Recentering Target | Defines the reference frame for horizontal recentering. The axis center will be dynamically updated to be behind the selected object. | |
Axis Center | Static reference frame. Axis center value is not dynamically updated. | |
Parent Object | Axis center is dynamically adjusted to be behind the parent object's forward. | |
Tracking Target | Axis center is dynamically adjusted to be behind the Tracking Target's forward. | |
LookAt Target | Axis center is dynamically adjusted to be behind the LookAt Target's forward. | |
Horizontal Axis | Horizontal positioning (rotation about the Y axis) of the camera on the surface. Value is in degrees, and Range defines the allowable value limits. If Wrap is checked, the value wraps around when it crosses the edge of its range. You can define a Center position here, which can be used if recentering logic is enabled in the axis driver. | |
Vertical Axis | Vertical positioning (rotation about the X axis) of the camera on the surface. Value is in degrees in Sphere mode, but is in arbitrary units in ThreeRing mode. Range defines the allowable value limits. If Wrap is checked, the value wraps around when it crosses the edge of its range. You can define a Center position here, which can be used if recentering logic is enabled in the axis driver. | |
Radial Axis | Controls the camera distance from the target by scaling the orbits. Value is a scalar multiplier of the orbit heights and radii. Range defines the allowable value limits. If Wrap is checked, the value wraps around when it crosses the edge of its range. You can define a Center position here, which can be used if recentering logic is enabled in the axis driver. | |
Recentering | If enabled for an axis, Recentering will gradually return the axis value to its Center. | |
Wait | If recentering is enabled for an axis, it will wait this many seconds after the last user input before beginning the recentering process. | |
Time | The time it takes for the recentering to complete, once it has started. |
Binding Modes
When following a target with an offset from the target, the binding mode defines the coordinate space Unity uses to interpret the camera offset from the target and to apply the damping.
Lock To Target
Makes the CinemachineCamera 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.
Start |
Pitch, 45 degrees |
Yaw, 45 degrees |
Roll, 45 degrees |
Lock To Target No Roll
Makes the CinemachineCamera use the local frame of the Follow target, with roll set to 0.
Start |
Pitch, 45 degrees |
Yaw, 45 degrees |
Roll, 45 degrees |
Lock To Target On Assign
Makes the orientation of the CinemachineCamera match the local frame of the Follow target, at the moment when the CinemachineCamera is activated or when the target is assigned. This offset remains constant in world space. The camera does not rotate along with the target.
Start |
Pitch, 45 degrees |
Yaw, 45 degrees |
Roll, 45 degrees |
Lock To Target With World Up
Makes the CinemachineCamera use the local frame of the Follow target with tilt and roll set to 0. This binding mode ignores all target rotations except yaw.
Start |
Pitch, 45 degrees |
Yaw, 45 degrees |
Roll, 45 degrees |
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.
Start |
Pitch, 45 degrees |
Yaw, 45 degrees |
Roll, 45 degrees |
Lazy Follow
Lazy follow 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 respect 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.
Start |
Pitch, 45 degrees |
Yaw, 45 degrees |
Roll, 45 degrees |