CinemachineClearShot Class

Cinemachine

CinemachineClearShot Class

Cinemachine ClearShot is a "manager camera" that owns and manages a set of Virtual Camera gameObject children. When Live, the ClearShot will check the children, and choose the one with the best quality shot and make it Live. This can be a very powerful tool. If the child cameras have CinemachineCollider extensions, they will analyze the scene for target obstructions, optimal target distance, and other items, and report their assessment of shot quality back to the ClearShot parent, who will then choose the best one. You can use this to set up complex multi-camera coverage of a scene, and be assured that a clear shot of the target will always be available. If multiple child cameras have the same shot quality, the one with the highest priority will be chosen. You can also define custom blends between the ClearShot children.
Inheritance Hierarchy
SystemObject  Object
    Component
      Behaviour
        MonoBehaviour
          CinemachineCinemachineVirtualCameraBase
            CinemachineCinemachineClearShot

Namespace:  Cinemachine
Assembly:  Cinemachine (in Cinemachine.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
[DocumentationSortingAttribute(12f, DocumentationSortingAttributeLevel.UserRef)]
[ExecuteInEditMode]
[DisallowMultipleComponent]
[AddComponentMenu("Cinemachine/CinemachineClearShot")]
public class CinemachineClearShot : CinemachineVirtualCameraBase
Cinemachine.CinemachineClearShot = function();

Type.createClass(
	'Cinemachine.CinemachineClearShot',
	Cinemachine.CinemachineVirtualCameraBase);

The CinemachineClearShot type exposes the following members.

Constructors
  NameDescription
Public methodCinemachineClearShot
Top
Properties
  NameDescription
Public propertyChildCameras
The list of child cameras. These are just the immediate children in the hierarchy.
Public propertyDescription
Gets a brief debug description of this virtual camera, for use when displayiong debug info
(Overrides CinemachineVirtualCameraBaseDescription.)
Public propertyFollow
Get the current Follow target. Returns parent's Follow if parent is non-null and no specific Follow defined for this camera
(Overrides CinemachineVirtualCameraBaseFollow.)
Public propertyIsBlending
Is there a blend in progress?
Public propertyLiveChild
Get the current "best" child virtual camera, that would be chosen if the ClearShot camera were active.
Public propertyLiveChildOrSelf
Return the live child.
(Overrides CinemachineVirtualCameraBaseLiveChildOrSelf.)
Public propertyLookAt
Get the current LookAt target. Returns parent's LookAt if parent is non-null and no specific LookAt defined for this camera
(Overrides CinemachineVirtualCameraBaseLookAt.)
Public propertyName
Get the name of the Virtual Camera. Base implementation returns the owner GameObject's name.
(Inherited from CinemachineVirtualCameraBase.)
Public propertyParentCamera
Support for meta-virtual-cameras. This is the situation where a virtual camera is in fact the public face of a private army of virtual cameras, which it manages on its own. This method gets the VirtualCamera owner, if any. Private armies are implemented as Transform children of the parent vcam.
(Inherited from CinemachineVirtualCameraBase.)
Public propertyPreviousStateIsValid
Set this to force the next update to ignore deltaTime and reset itself
(Inherited from CinemachineVirtualCameraBase.)
Public propertyPriority
Get the Priority of the virtual camera. This determines its placement in the CinemachineCore's queue of eligible shots.
(Inherited from CinemachineVirtualCameraBase.)
Public propertyState
The CameraState of the currently live child
(Overrides CinemachineVirtualCameraBaseState.)
Public propertyValidatingStreamVersion
Version that was last streamed, for upgrading legacy
(Inherited from CinemachineVirtualCameraBase.)
Public propertyVirtualCameraGameObject
The GameObject owner of the Virtual Camera behaviour.
(Inherited from CinemachineVirtualCameraBase.)
Top
Methods
  NameDescription
Public methodAddPostPipelineStageHook
A delegate to hook into the state calculation pipeline. This will be called after each pipeline stage, to allow others to hook into the pipeline. See CinemachineCore.Stage.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodInvokePostPipelineStageCallback
Invokes the PostPipelineStageDelegate for this camera, and up the hierarchy for all parent cameras (if any).
(Inherited from CinemachineVirtualCameraBase.)
Public methodIsLiveChild
Check whether the vcam a live child of this camera.
(Overrides CinemachineVirtualCameraBaseIsLiveChild(ICinemachineCamera).)
Public methodMoveToTopOfPrioritySubqueue
When multiple virtual cameras have the highest priority, there is sometimes the need to push one to the top, making it the current Live camera if it shares the highest priority in the queue with its peers. This happens automatically when a new vcam is enabled: the most recent one goes to the top of the priority subqueue. Use this method to push a vcam to the top of its priority peers. If it and its peers share the highest priority, then this vcam will become Live.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodOnDestroy
Base class implementation removes the virtual camera from the priority queue.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodOnDisable
Base class implementation makes sure the priority queue remains up-to-date.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodOnEnable
Makes sure the internal child cache is up to date
(Overrides CinemachineVirtualCameraBaseOnEnable.)
Public methodOnTransformChildrenChanged
Makes sure the internal child cache is up to date
Protected methodOnTransformParentChanged
Base class implementation makes sure the priority queue remains up-to-date.
(Inherited from CinemachineVirtualCameraBase.)
Public methodOnTransitionFromCamera
Notification that this virtual camera is going live. This implementation resets the child randomization.
(Overrides CinemachineVirtualCameraBaseOnTransitionFromCamera(ICinemachineCamera).)
Protected methodOnValidate
Enforce bounds for fields, when changed in inspector. Call base class implementation at the beginning of overridden method. After base method is called, ValidatingStreamVersion will be valid.
(Inherited from CinemachineVirtualCameraBase.)
Public methodPreUpdateChildCameras
This is called prior to the updating of the vcam's child cameras, in order to allow the parent to prepare its children. If the children are updating on FixedUpdate, then this will not necessarily be called prior to every FixedUpdate, but it might be called on LateUpdate instead. Base class implementation does nothing.
(Inherited from CinemachineVirtualCameraBase.)
Public methodRemovePostPipelineStageHook
Remove a Pipeline stage hook callback. Make sure it is removed from all the children.
(Overrides CinemachineVirtualCameraBaseRemovePostPipelineStageHook(CinemachineVirtualCameraBaseOnPostPipelineStageDelegate).)
Public methodResetRandomization
If RandomizeChoice is enabled, call this to re-randomize the children next frame. This is useful if you want to freshen up the shot.
Protected methodResolveFollow
Returns this vcam's Follow target, or if that is null, will retrun the parent vcam's Follow target.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodResolveLookAt
Returns this vcam's LookAt target, or if that is null, will retrun the parent vcam's LookAt target.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodStart
Base class implementation does nothing.
(Inherited from CinemachineVirtualCameraBase.)
Protected methodUpdate
Base class implementation makes sure the priority queue remains up-to-date.
(Inherited from CinemachineVirtualCameraBase.)
Public methodUpdateCameraState
Called by CinemachineCore at designated update time so the vcam can position itself and track its targets. This implementation updates all the children, chooses the best one, and implements any required blending.
(Overrides CinemachineVirtualCameraBaseUpdateCameraState(Vector3, Single).)
Top
Fields
  NameDescription
Public fieldCinemachineGUIDebuggerCallback
This is deprecated. It is here to support the soon-to-be-removed Cinemachine Debugger in the Editor.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldm_ActivateAfter
Wait this many seconds before activating a new child camera
Public fieldm_ChildCameras
Internal API for the editor. Do not use this filed.
Public fieldm_CustomBlends
This is the asset which contains custom settings for specific blends
Public fieldm_DefaultBlend
The blend which is used if you don't explicitly define a blend between two Virtual Cameras
Public fieldm_ExcludedPropertiesInInspector
Inspector control - Use for hiding sections of the Inspector UI.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldm_Follow
Default object for the camera children wants to move with (the body target), if not specified in a child camera. May be empty.
Public fieldm_LockStageInInspector
Inspector control - Use for enabling sections of the Inspector UI.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldm_LookAt
Default object for the camera children to look at (the aim target), if not specified in a child camera. May be empty.
Public fieldm_MinDuration
An active camera must be active for at least this many seconds, unless a higher-priority camera wants to activate
Public fieldm_Priority
The priority will determine which camera becomes active based on the state of other cameras and this camera. Higher numbers have greater priority.
(Inherited from CinemachineVirtualCameraBase.)
Public fieldm_RandomizeChoice
If checked, camera choice will be randomized if multiple cameras are equally desirable. Otherwise, child list order will be used
Public fieldm_ShowDebugText
When enabled, the current camera and blend will be indicated in the game window, for debugging
Protected fieldOnPostPipelineStage
A delegate to hook into the state calculation pipeline. Implementaion must be sure to call this after each pipeline stage, to allow other services to hook into the pipeline. See CinemachineCore.Stage.
(Inherited from CinemachineVirtualCameraBase.)
Top
See Also