Class CinemachineDecollider
An add-on module for CinemachineCamera that post-processes the final position of the camera. Based on the supplied settings, the Decollider will pull the camera out of any objects it is intersecting.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Extensions/Cinemachine Decollider")]
[ExecuteAlways]
[DisallowMultipleComponent]
[RequiredTarget(RequiredTargetAttribute.RequiredTargets.Tracking)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineDecollider.html")]
public class CinemachineDecollider : CinemachineExtension
Fields
CameraRadius
Camera will try to maintain this distance from any obstacle or terrain.
Declaration
[Tooltip("Camera will try to maintain this distance from any obstacle or terrain. Increase it if necessary to keep the camera from clipping the near edge of obsacles.")]
public float CameraRadius
Field Value
Type | Description |
---|---|
float |
Decollision
When enabled, will attempt to push the camera out of intersecting objects
Declaration
[FoldoutWithEnabledButton("Enabled")]
public CinemachineDecollider.DecollisionSettings Decollision
Field Value
Type | Description |
---|---|
Cinemachine |
TerrainResolution
When enabled, will attempt to place the camera on top of terrain layers
Declaration
[FoldoutWithEnabledButton("Enabled")]
public CinemachineDecollider.TerrainSettings TerrainResolution
Field Value
Type | Description |
---|---|
Cinemachine |
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
OnDestroy()
Cleanup
Declaration
protected override void OnDestroy()
Overrides
PostPipelineStageCallback(CinemachineVirtualCameraBase, Stage, ref CameraState, float)
Callback to do the collision resolution and shot evaluation
Declaration
protected override void PostPipelineStageCallback(CinemachineVirtualCameraBase vcam, CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
Cinemachine |
vcam | The virtual camera being processed |
Cinemachine |
stage | The current pipeline stage |
Camera |
state | The current virtual camera state |
float | deltaTime | The current applicable deltaTime |