Class CinemachineClearShot
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 shot evaluator 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
Inherited Members
Namespace: Unity.Cinemachine
Assembly: solution.dll
Syntax
[DisallowMultipleComponent]
[ExecuteAlways]
[ExcludeFromPreset]
[AddComponentMenu("Cinemachine/Cinemachine ClearShot")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.0/manual/CinemachineClearShot.html")]
public class CinemachineClearShot : CinemachineCameraManagerBase, ICinemachineMixer, ICinemachineCamera
Fields
Name | Description |
---|---|
ActivateAfter | Wait this many seconds before activating a new child camera |
MinDuration | An active camera must be active for at least this many seconds |
RandomizeChoice | If checked, camera choice will be randomized if multiple cameras are equally desirable. |
Methods
Name | Description |
---|---|
ChooseCurrentCamera(Vector3, float) | Choose the appropriate current camera from among the ChildCameras, based on current state. If the returned camera is different from the current camera, an appropriate transition will be made. |
OnTransitionFromCamera(ICinemachineCamera, Vector3, float) | Notification that this virtual camera is going live. |
PerformLegacyUpgrade(int) | Override this to handle any upgrades necessitated by a streaming version change. Note that since this method is not called from the main thread, there are many things it cannot do, including checking a unity object for null. |
Reset() | Reset the component to default values. |
ResetRandomization() | If RandomizeChoice is enabled, call this to re-randomize the children next frame. This is useful if you want to freshen up the shot. |