Class CinemachineFollow
This is a CinemachineComponent in the Body section of the component pipeline. Its job is to position the camera in a fixed relationship to the vcam's Tracking Target object, with offsets and damping.
This component will only change the camera's position in space. It will not re-orient or otherwise aim the camera. To to that, you need to instruct the camera in the Aim section of its pipeline.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Position Control/Cinemachine Follow")]
[DisallowMultipleComponent]
[CameraPipeline(CinemachineCore.Stage.Body)]
[RequiredTarget(RequiredTargetAttribute.RequiredTargets.Tracking)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineFollow.html")]
public class CinemachineFollow : CinemachineComponentBase
Fields
FollowOffset
The distance which the camera will attempt to maintain from the tracking target
Declaration
[Tooltip("The distance vector that the camera will attempt to maintain from the tracking target")]
public Vector3 FollowOffset
Field Value
Type | Description |
---|---|
Vector3 |
TrackerSettings
Settings to control damping for target tracking.
Declaration
public TrackerSettings TrackerSettings
Field Value
Type | Description |
---|---|
TrackerSettings |
Properties
IsValid
True if component is enabled and has a valid Follow target
Declaration
public override bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Stage
Get the Cinemachine Pipeline stage that this component implements. Always returns the Body stage
Declaration
public override CinemachineCore.Stage Stage { get; }
Property Value
Type | Description |
---|---|
CinemachineCore.Stage |
Overrides
Methods
ForceCameraPosition(Vector3, Quaternion)
Force the virtual camera to assume a given position and orientation
Declaration
public override void ForceCameraPosition(Vector3 pos, Quaternion rot)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | pos | World-space position to take |
Quaternion | rot | World-space orientation to take |
Overrides
GetMaxDampTime()
Report maximum damping time needed for this component.
Declaration
public override float GetMaxDampTime()
Returns
Type | Description |
---|---|
float | Highest damping setting in this component |
Overrides
MutateCameraState(ref CameraState, float)
Positions the virtual camera according to the transposer rules.
Declaration
public override void MutateCameraState(ref CameraState curState, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
CameraState | curState | The current camera state |
float | deltaTime | Used for damping. If less than 0, no damping is done. |
Overrides
OnTargetObjectWarped(Transform, Vector3)
This is called to notify the user that a target got warped, so that we can update its internal state to make the camera also warp seamlessly.
Declaration
public override void OnTargetObjectWarped(Transform target, Vector3 positionDelta)
Parameters
Type | Name | Description |
---|---|---|
Transform | target | The object that was warped |
Vector3 | positionDelta | The amount the target's position changed |