docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct AxisState.Recentering

    Helper for automatic axis recentering

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Cinemachine
    Assembly: Unity.Cinemachine.dll
    Syntax
    [Obsolete("AxisState.Recentering is deprecated.  Use InputAxis and InputAxisController instead")]
    [Serializable]
    public struct AxisState.Recentering

    Constructors

    Recentering(bool, float, float)

    Constructor with specific field values

    Declaration
    public Recentering(bool enabled, float waitTime, float recenteringTime)
    Parameters
    Type Name Description
    bool enabled
    float waitTime
    float recenteringTime

    Fields

    m_RecenteringTime

    How long it takes to reach destination once recentering has started

    Declaration
    [Tooltip("How long it takes to reach destination once recentering has started.")]
    public float m_RecenteringTime
    Field Value
    Type Description
    float

    m_WaitTime

    If no input has been detected, the camera will wait this long in seconds before moving its heading to the default heading.

    Declaration
    [Tooltip("If no user input has been detected on the axis, the axis will wait this long in seconds before recentering.")]
    public float m_WaitTime
    Field Value
    Type Description
    float

    m_enabled

    If checked, will enable automatic recentering of the axis. If FALSE, recenting is disabled.

    Declaration
    [Tooltip("If checked, will enable automatic recentering of the axis. If unchecked, recenting is disabled.")]
    public bool m_enabled
    Field Value
    Type Description
    bool

    Methods

    CancelRecentering()

    Cancel any recenetering in progress.

    Declaration
    public void CancelRecentering()

    CopyStateFrom(ref Recentering)

    Copy Recentering state from another Recentering component.

    Declaration
    public void CopyStateFrom(ref AxisState.Recentering other)
    Parameters
    Type Name Description
    AxisState.Recentering other

    DoRecentering(ref AxisState, float, float)

    Bring the axis back to the centered state (only if enabled).

    Declaration
    public void DoRecentering(ref AxisState axis, float deltaTime, float recenterTarget)
    Parameters
    Type Name Description
    AxisState axis

    The axis to recenter

    float deltaTime

    Current effective deltaTime

    float recenterTarget

    The value that is considered to be centered

    RecenterNow()

    Skip the wait time and start recentering now (only if enabled).

    Declaration
    public void RecenterNow()

    Validate()

    Call this from OnValidate()

    Declaration
    public void Validate()
    In This Article
    Back to top
    Copyright © 2025 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)