Class CinemachineFollowZoom
An add-on module for Cm Camera that adjusts the FOV of the lens to keep the target object at a constant size on the screen, regardless of camera and target position.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Extensions/Cinemachine Follow Zoom")]
[ExecuteAlways]
[DisallowMultipleComponent]
[RequiredTarget(RequiredTargetAttribute.RequiredTargets.LookAt)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineFollowZoom.html")]
public class CinemachineFollowZoom : CinemachineExtension
Fields
Damping
Increase this value to soften the aggressiveness of the follow-zoom. Small numbers are more responsive, larger numbers give a more heavy slowly responding camera.
Declaration
[Range(0, 20)]
[Tooltip("Increase this value to soften the aggressiveness of the follow-zoom. Small numbers are more responsive, larger numbers give a more heavy slowly responding camera.")]
[FormerlySerializedAs("m_Damping")]
public float Damping
Field Value
Type | Description |
---|---|
float |
FovRange
Range for the FOV that this behaviour will generate.
Declaration
[MinMaxRangeSlider(1, 179)]
[Tooltip("Range for the FOV that this behaviour will generate.")]
public Vector2 FovRange
Field Value
Type | Description |
---|---|
Vector2 |
Width
The shot width to maintain, in world units, at target distance. FOV will be adjusted as far as possible to maintain this width at the target distance from the camera.
Declaration
[Tooltip("The shot width to maintain, in world units, at target distance.")]
[FormerlySerializedAs("m_Width")]
public float Width
Field Value
Type | Description |
---|---|
float |
Methods
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
PostPipelineStageCallback(CinemachineVirtualCameraBase, Stage, ref CameraState, float)
Callback to preform the zoom adjustment
Declaration
protected override void PostPipelineStageCallback(CinemachineVirtualCameraBase vcam, CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
CinemachineVirtualCameraBase | vcam | The virtual camera being processed |
CinemachineCore.Stage | stage | The current pipeline stage |
CameraState | state | The current virtual camera state |
float | deltaTime | The current applicable deltaTime |