docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRControllerState

    Represents a serializable state of the XR Interactor for use with recording and playback.

    Inheritance
    object
    XRControllerState
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [Serializable]
    public class XRControllerState
    Remarks

    Use of this class should be avoided outside of the context of playback and recording. Instead, use XRBaseInputInteractor.LogicalInputState properties in XRBaseInputInteractor when possible.

    Constructors

    XRControllerState()

    Initializes and returns an instance of XRControllerState.

    Declaration
    public XRControllerState()
    See Also
    XRControllerRecording

    XRControllerState(double, Vector3, Quaternion, InputTrackingState, bool)

    Initializes and returns an instance of XRControllerState.

    Declaration
    protected XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool isTracked)
    Parameters
    Type Name Description
    double time

    The time value for this controller.

    Vector3 position

    The position for this controller.

    Quaternion rotation

    The rotation for this controller.

    InputTrackingState inputTrackingState

    The inputTrackingState for this controller.

    bool isTracked

    Whether the controller is tracked this frame.

    See Also
    XRControllerRecording

    XRControllerState(double, Vector3, Quaternion, InputTrackingState, bool, bool, bool, bool)

    Initializes and returns an instance of XRControllerState.

    Declaration
    public XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool isTracked, bool selectActive, bool activateActive, bool pressActive)
    Parameters
    Type Name Description
    double time

    The time value for this controller.

    Vector3 position

    The position for this controller.

    Quaternion rotation

    The rotation for this controller.

    InputTrackingState inputTrackingState

    The inputTrackingState for this controller.

    bool isTracked

    Whether the controller is tracked this frame.

    bool selectActive

    Whether select is active or not.

    bool activateActive

    Whether activate is active or not.

    bool pressActive

    Whether UI press is active or not.

    See Also
    XRControllerRecording

    XRControllerState(double, Vector3, Quaternion, InputTrackingState, bool, bool, bool, bool, float, float, float)

    Initializes and returns an instance of XRControllerState.

    Declaration
    public XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool isTracked, bool selectActive, bool activateActive, bool pressActive, float selectValue, float activateValue, float pressValue)
    Parameters
    Type Name Description
    double time

    The time value for this controller.

    Vector3 position

    The position for this controller.

    Quaternion rotation

    The rotation for this controller.

    InputTrackingState inputTrackingState

    The inputTrackingState for this controller.

    bool isTracked

    Whether the controller is tracked this frame.

    bool selectActive

    Whether select is active or not.

    bool activateActive

    Whether activate is active or not.

    bool pressActive

    Whether UI press is active or not.

    float selectValue

    The select value.

    float activateValue

    The activate value.

    float pressValue

    The UI press value.

    See Also
    XRControllerRecording

    XRControllerState(XRControllerState)

    Initializes and returns an instance of XRControllerState.

    Declaration
    public XRControllerState(XRControllerState value)
    Parameters
    Type Name Description
    XRControllerState value

    The XRControllerState object used to create this object.

    See Also
    XRControllerRecording

    Fields

    activateInteractionState

    The activate interaction state.

    Declaration
    public InteractionState activateInteractionState
    Field Value
    Type Description
    InteractionState
    See Also
    XRControllerRecording

    inputTrackingState

    The input tracking state of the controller.

    Declaration
    public InputTrackingState inputTrackingState
    Field Value
    Type Description
    InputTrackingState
    See Also
    XRControllerRecording

    isTracked

    Whether the controller is actively tracked.

    Declaration
    public bool isTracked
    Field Value
    Type Description
    bool
    See Also
    XRControllerRecording

    position

    The position of the controller.

    Declaration
    public Vector3 position
    Field Value
    Type Description
    Vector3
    See Also
    XRControllerRecording

    rotation

    The rotation of the controller.

    Declaration
    public Quaternion rotation
    Field Value
    Type Description
    Quaternion
    See Also
    XRControllerRecording

    selectInteractionState

    The selection interaction state.

    Declaration
    public InteractionState selectInteractionState
    Field Value
    Type Description
    InteractionState
    See Also
    XRControllerRecording

    time

    The time value for this controller.

    Declaration
    public double time
    Field Value
    Type Description
    double
    See Also
    XRControllerRecording

    uiPressInteractionState

    The UI press interaction state.

    Declaration
    public InteractionState uiPressInteractionState
    Field Value
    Type Description
    InteractionState
    See Also
    XRControllerRecording

    uiScrollValue

    The UI scroll value.

    Declaration
    public Vector2 uiScrollValue
    Field Value
    Type Description
    Vector2
    See Also
    XRControllerRecording

    Methods

    ResetFrameDependentStates()

    Resets all the interaction states that are based on whether they occurred "this frame".

    Declaration
    public void ResetFrameDependentStates()
    See Also
    ResetFrameDependent()

    ToString()

    Converts state data to a string.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation.

    Overrides
    object.ToString()
    See Also
    XRControllerRecording

    See Also

    XRControllerRecording
    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)