Class CinemachineFollowZoom
An add-on module for Cinemachine Virtual 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: Cinemachine
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[AddComponentMenu("")]
[ExecuteAlways]
[DisallowMultipleComponent]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@2.9/manual/CinemachineFollowZoom.html")]
public class CinemachineFollowZoom : CinemachineExtension
Fields
m_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(0F, 20F)]
[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.")]
public float m_Damping
Field Value
Type | Description |
---|---|
Single |
m_MaxFOV
Will not generate an FOV larget than this.
Declaration
[Range(1F, 179F)]
[Tooltip("Upper limit for the FOV that this behaviour will generate.")]
public float m_MaxFOV
Field Value
Type | Description |
---|---|
Single |
m_MinFOV
Will not generate an FOV smaller than this.
Declaration
[Range(1F, 179F)]
[Tooltip("Lower limit for the FOV that this behaviour will generate.")]
public float m_MinFOV
Field Value
Type | Description |
---|---|
Single |
m_Width
The shot width to maintain, in world units, at target distance. FOV will be adusted 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.")]
public float m_Width
Field Value
Type | Description |
---|---|
Single |
Methods
GetMaxDampTime()
Report maximum damping time needed for this component.
Declaration
public override float GetMaxDampTime()
Returns
Type | Description |
---|---|
Single | Highest damping setting in this component |
Overrides
PostPipelineStageCallback(CinemachineVirtualCameraBase, CinemachineCore.Stage, ref CameraState, Single)
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 |
Single | deltaTime | The current applicable deltaTime |