Interface ICinemachineCamera | Cinemachine | 2.5.0
docs.unity3d.com
    Show / Hide Table of Contents

    Interface ICinemachineCamera

    An abstract representation of a virtual camera which lives within the Unity scene

    Namespace: Cinemachine
    Syntax
    public interface ICinemachineCamera

    Properties

    Description

    Gets a brief debug description of this virtual camera, for use when displayiong debug info

    Declaration
    string Description { get; }
    Property Value
    Type Description
    String

    Follow

    The thing the camera wants to follow (moving camera). May be null.

    Declaration
    Transform Follow { get; set; }
    Property Value
    Type Description
    Transform

    IsValid

    Will return false if this references a deleted object

    Declaration
    bool IsValid { get; }
    Property Value
    Type Description
    Boolean

    LookAt

    The thing the camera wants to look at (aim). May be null.

    Declaration
    Transform LookAt { get; set; }
    Property Value
    Type Description
    Transform

    Name

    Gets the name of this virtual camera. For use when deciding how to blend to or from this camera

    Declaration
    string Name { get; }
    Property Value
    Type Description
    String

    ParentCamera

    For cameras that implement child cameras, returns the parent vcam, otherwise null.

    Declaration
    ICinemachineCamera ParentCamera { get; }
    Property Value
    Type Description
    ICinemachineCamera

    Priority

    Gets the priority of this ICinemachineCamera. The virtual camera will be inserted into the global priority stack based on this value.

    Declaration
    int Priority { get; set; }
    Property Value
    Type Description
    Int32

    State

    Camera state at the current time.

    Declaration
    CameraState State { get; }
    Property Value
    Type Description
    CameraState

    VirtualCameraGameObject

    Gets the virtual camera game attached to this class.

    Declaration
    GameObject VirtualCameraGameObject { get; }
    Property Value
    Type Description
    GameObject

    Methods

    InternalUpdateCameraState(Vector3, Single)

    Updates this Cinemachine Camera. For an active camera this should be called once and only once each frame. To guarantee this, you should never call this method directly. Always use CinemachineCore.UpdateVirtualCamera(ICinemachineCamera, Vector3, float), which has protection against multiple calls per frame.

    Declaration
    void InternalUpdateCameraState(Vector3 worldUp, float deltaTime)
    Parameters
    Type Name Description
    Vector3 worldUp

    Default world Up, set by the CinemachineBrain

    Single deltaTime

    Delta time for time-based effects (ignore if less than 0)

    IsLiveChild(ICinemachineCamera, Boolean)

    Check whether the vcam is a live child of this camera.

    Declaration
    bool IsLiveChild(ICinemachineCamera vcam, bool dominantChildOnly = false)
    Parameters
    Type Name Description
    ICinemachineCamera vcam

    The Virtual Camera to check

    Boolean dominantChildOnly

    If truw, will only return true if this vcam is the dominat live child

    Returns
    Type Description
    Boolean

    True if the vcam is currently actively influencing the state of this vcam

    OnTargetObjectWarped(Transform, Vector3)

    This is called to notify the component that a target got warped, so that the component can update its internal state to make the camera also warp seamlessy. Base class implementation does nothing.

    Declaration
    void OnTargetObjectWarped(Transform target, Vector3 positionDelta)
    Parameters
    Type Name Description
    Transform target

    The object that was warped

    Vector3 positionDelta

    The amount the target's position changed

    OnTransitionFromCamera(ICinemachineCamera, Vector3, Single)

    Notification that a new camera is being activated. This is sent to the currently active camera. Both may be active simultaneously for a while, if blending.

    Declaration
    void OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime)
    Parameters
    Type Name Description
    ICinemachineCamera fromCam

    The camera being deactivated. May be null.

    Vector3 worldUp

    Default world Up, set by the CinemachineBrain

    Single deltaTime

    Delta time for time-based effects (ignore if less than 0)

    UpdateCameraState(Vector3, Single)

    Update the camera's state. The implementation must guarantee against multiple calls per frame, and should use CinemachineCore.UpdateVirtualCamera(ICinemachineCamera, Vector3, mfloat), which has protection against multiple calls per frame.

    Declaration
    void UpdateCameraState(Vector3 worldUp, float deltaTime)
    Parameters
    Type Name Description
    Vector3 worldUp

    Default world Up, set by the CinemachineBrain

    Single deltaTime

    Delta time for time-based effects (ignore if less than 0)

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023