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
CinemachineDecollider
Inherited Members
Component.GetComponentIndex()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Scene)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
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 |
---|---|
CinemachineDecollider.DecollisionSettings |
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 |
---|---|
CinemachineDecollider.TerrainSettings |
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 |
---|---|---|
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 |