Class CinemachineAutoFocus
This behaviour will drive the Camera focusDistance property. It can be used to hold focus onto a specific object, or (in HDRP) to auto-detect what is in front of the camera and focus on that.
Camera.focusDistance is only available in physical mode, and appropriate processing must be installed for it to have any visible effect.
This component's ScreenCenter mode is only available in HDRP projects, and in this mode the component cannot be dynamically added at runtime; it must be added in the editor.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: solution.dll
Syntax
[ExecuteAlways]
[AddComponentMenu("Cinemachine/Procedural/Extensions/Cinemachine Auto Focus")]
[DisallowMultipleComponent]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.0/manual/CinemachineAutoFocus.html")]
public class CinemachineAutoFocus : CinemachineExtension
Fields
Name | Description |
---|---|
CustomTarget | The target to use if Focus Target is set to Custom Target |
Damping | Set this to make the focus adjust gradually to the desired setting. The value corresponds approximately to the time the focus will take to adjust to the new value. |
FocusDepthOffset | Offsets the sharpest point away in depth from the focus target location |
FocusTarget | The camera's focus distance will be set to the distance from the camera to the selected target. The Focus Offset field will then modify that distance. |
Methods
Name | Description |
---|---|
PostPipelineStageCallback(CinemachineVirtualCameraBase, Stage, ref CameraState, float) | Apply PostProcessing effects |