docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CinemachineCamera

    This behaviour is intended to be attached to an empty GameObject, and it represents a Cinemachine Camera within the Unity scene.

    The CinemachineCamera will animate its Transform according to the rules contained in its CinemachineComponent pipeline (Aim, Body, and Noise). When the CM camera is Live, the Unity camera will assume the position and orientation of the CinemachineCamera.

    A CinemachineCamera is not a camera. Instead, it can be thought of as a camera controller, not unlike a cameraman. It can drive the Unity Camera and control its position, rotation, lens settings, and PostProcessing effects. Each CM Camera owns its own Cinemachine Component Pipeline, through which you can provide the instructions for procedurally tracking specific game objects. An empty procedural pipeline will result in a passive CinemachineCamera, which can be controlled in the same way as an ordinary GameObject.

    A CinemachineCamera is very lightweight, and does no rendering of its own. It merely tracks interesting GameObjects, and positions itself accordingly. A typical game can have dozens of CinemachineCameras, each set up to follow a particular character or capture a particular event.

    A CinemachineCamera can be in any of three states:

    • Live: The CinemachineCamera is actively controlling the Unity Camera. The CinemachineCamera is tracking its targets and being updated every frame.
    • Standby: The CinemachineCamera is tracking its targets and being updated every frame, but no Unity Camera is actively being controlled by it. This is the state of a CinemachineCamera that is enabled in the scene but perhaps at a lower priority than the Live CinemachineCamera.
    • Disabled: The CinemachineCamera is present but disabled in the scene. It is not actively tracking its targets and so consumes no processing power. However, the CinemachineCamera can be made live from the Timeline.

    The Unity Camera can be driven by any CinemachineCamera in the scene. The game logic can choose the CinemachineCamera to make live by manipulating the CM camerass enabled flags and/or its priority, based on game logic.

    In order to be driven by a CinemachineCamera, the Unity Camera must have a CinemachineBrain behaviour, which will select the most eligible CinemachineCamera based on its priority or on other criteria, and will manage blending.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    CinemachineVirtualCameraBase
    CinemachineCamera
    Implements
    ICinemachineCamera
    Inherited Members
    CinemachineVirtualCameraBase.Priority
    CinemachineVirtualCameraBase.OutputChannel
    CinemachineVirtualCameraBase.FollowTargetAttachment
    CinemachineVirtualCameraBase.LookAtTargetAttachment
    CinemachineVirtualCameraBase.StandbyUpdate
    CinemachineVirtualCameraBase.DetachedFollowTargetDamp(float, float, float)
    CinemachineVirtualCameraBase.DetachedFollowTargetDamp(Vector3, Vector3, float)
    CinemachineVirtualCameraBase.DetachedFollowTargetDamp(Vector3, float, float)
    CinemachineVirtualCameraBase.DetachedLookAtTargetDamp(float, float, float)
    CinemachineVirtualCameraBase.DetachedLookAtTargetDamp(Vector3, Vector3, float)
    CinemachineVirtualCameraBase.DetachedLookAtTargetDamp(Vector3, float, float)
    CinemachineVirtualCameraBase.Name
    CinemachineVirtualCameraBase.Description
    CinemachineVirtualCameraBase.IsValid
    CinemachineVirtualCameraBase.ParentCamera
    CinemachineVirtualCameraBase.PreviousStateIsValid
    CinemachineVirtualCameraBase.UpdateCameraState(Vector3, float)
    CinemachineVirtualCameraBase.OnCameraActivated(ICinemachineCamera.ActivationEventParams)
    CinemachineVirtualCameraBase.ResolveLookAt(Transform)
    CinemachineVirtualCameraBase.ResolveFollow(Transform)
    CinemachineVirtualCameraBase.MoveToTopOfPrioritySubqueue()
    CinemachineVirtualCameraBase.Prioritize()
    CinemachineVirtualCameraBase.FollowTargetChanged
    CinemachineVirtualCameraBase.LookAtTargetChanged
    CinemachineVirtualCameraBase.UpdateTargetCache()
    CinemachineVirtualCameraBase.FollowTargetAsGroup
    CinemachineVirtualCameraBase.FollowTargetAsVcam
    CinemachineVirtualCameraBase.LookAtTargetAsGroup
    CinemachineVirtualCameraBase.LookAtTargetAsVcam
    CinemachineVirtualCameraBase.IsLive
    CinemachineVirtualCameraBase.IsParticipatingInBlend()
    CinemachineVirtualCameraBase.CancelDamping(bool)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Cinemachine
    Assembly: solution.dll
    Syntax
    [DisallowMultipleComponent]
    [ExecuteAlways]
    [AddComponentMenu("Cinemachine/Cinemachine Camera")]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.0/manual/CinemachineCamera.html")]
    public sealed class CinemachineCamera : CinemachineVirtualCameraBase, ICinemachineCamera

    Fields

    Name Description
    BlendHint

    Hint for transitioning to and from this CinemachineCamera. Hints can be combined, although not all combinations make sense. In the case of conflicting hints, Cinemachine will make an arbitrary choice.

    Lens

    Specifies the LensSettings of this camera. These settings will be transferred to the Unity camera when the CM Camera is live.

    Target

    The Tracking and LookAt targets for this camera.

    Properties

    Name Description
    Follow

    Get the current Follow target. Returns parent's Follow if parent is non-null and no specific Follow defined for this camera

    LookAt

    Get the current LookAt target. Returns parent's LookAt if parent is non-null and no specific LookAt defined for this camera

    State

    The current camera state, which will applied to the Unity Camera

    Methods

    Name Description
    ForceCameraPosition(Vector3, Quaternion)

    Force the CinemachineCamera to assume a given position and orientation

    GetCinemachineComponent(Stage)

    Get the component set for a specific stage in the pipeline.

    GetMaxDampTime()

    Query components and extensions for the maximum damping time.

    InternalUpdateCameraState(Vector3, float)

    Internal use only. Called by CinemachineCore at designated update time so the vcam can position itself and track its targets.

    OnTargetObjectWarped(Transform, Vector3)

    This is called to notify the CinemachineCamera that a target got warped, so that the CinemachineCamera can update its internal state to make the camera also warp seamlessly.

    OnTransitionFromCamera(ICinemachineCamera, Vector3, float)

    Handle transition from another CinemachineCamera. InheritPosition is implemented here.

    Extension Methods

    CinemachineInputProviderExtensions.GetInputAxisProvider(CinemachineVirtualCameraBase)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)