Position Composer
This CinemachineCamera Position Control behavior moves the camera to maintain a desired screen-space position for the Tracking Target. You can also specify offsets, damping, and composition rules. Position Composer only changes the camera’s position in space; it does not rotate the camera. To control the view angle of the camera, set the CinemachineCamera's rotation in its transform, or add a procedural Rotation Control component to the CinemachineCamera.
Position Composer is good for 2D and orthographic cameras, and it also works with perspective cameras and 3D environments.
This algorithm first moves the camera along the camera Z axis until the Tracking 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 Tracking Target is at the desired point on the camera’s screen.
Properties
Property | Function | |
---|---|---|
Target Offset | Position in target-local coordinates of the point of interest on the target to be tracked. 0, 0, 0 would be the target's origin. | |
Lookahead Time | Adjusts the offset of the Cinemachine Camera from the Tracking target based on the motion of the target. Cinemachine estimates the point where the target will be this many seconds into the future. This feature is sensitive to noisy animation and can amplify the noise, resulting in undesirable camera jitter. If the camera jitters unacceptably when the target is in motion, turn down this property, or animate the target more smoothly. | |
Lookahead Smoothing | The smoothness of the lookahead algorithm. Larger values smooth out jittery predictions and increase prediction lag. | |
Lookahead Ignore Y | If enabled, ignore movement along the Y axis for lookahead calculations. | |
Camera Distance | The distance to maintain along the camera axis from the Tracking target. | |
Dead Zone Depth | Do not move the camera along its z-axis if the Tracking target is within this distance of the specified camera distance. | |
Damping | How responsively the camera tries to maintain the desired position, in each of the three camera-space axes. Small numbers make the camera more responsive. Larger numbers make the camera respond more slowly. Using different settings per axis can yield a wide range of camera behaviors. | |
Screen Position | Horizontal and vertical screen position for the target. The camera adjusts to position the tracked object here. 0 is the screen center, -0.5 and 0.5 are the screen edges. | |
Dead Zone | The camera will not adjust when the target is within this range of the Screen Position. | |
Size | The width and height of the region where the camera will not respond to target movement, expressed as a fraction of screen size. This region is centered around the Screen Position. A value of 1 means full screen width or height. | |
Hard Limits | The camera will not allow the target to be outside of the hard limits. | |
Size | The size of the region in which the camera can place the target, expressed as a fraction of screen size. This region is by default centered around the Screen Position, but can be shifted using the Offset setting. A value of 1 means full screen width or height. | |
Offset | Shifts the hard limits horizontally or vertically relative to the Target Position. | |
Center On Activate | Moves the camera to put the target at the center of the dead zone when the camera becomes live. |
Shot composition
This component defines areas in the camera frame for you to compose a shot:
Dead zone: The area of the frame in which Cinemachine keeps the target. The target can move within this region and the CinemachineCamera will not adjust to reframe it until the target leaves the dead zone.
Soft zone: If the target enters this region of the frame, the camera will adjust to put it back in the dead zone. It will do this slowly or quickly, according to the time specified in the Damping settings.
Screen Position: The screen position of the center of the dead zone. 0 is the center of the screen, +1 and -1 are the edges.
Damping: Simulates the lag that a real camera operator introduces while operating a heavy physical camera. Damping specifies how quickly or slowly the camera reacts when the target enters the soft zone while the camera tracks the target. Use small numbers to simulate a more responsive camera, rapidly moving or aiming the camera to keep the target in the dead zone. Larger numbers simulate heavier cameras, The larger the value, the more Cinemachine allows the target to traverse the soft zone.
The Game View Guide gives an interactive, visual indication of these areas. The guides appear as tinted areas in the Game view.
The clear area indicates the dead zone. The blue-tinted area indicates the soft zone. The Screen Position is the center of the Dead Zone. The red-tinted area indicates the no pass area, which the camera prevents the target from entering. The yellow square indicates the target itself.
Adjust these areas to get a wide range of camera behaviors. To do this, drag their edges in the Game view or edit their properties in the Inspector window. For example, use a larger soft zone for a fast-moving target, or enlarge dead zone to create an area in the middle of the camera frame that is immune to target motion. Use this feature for things like animation cycles, where you don’t want the camera to track the target if it moves just a little.