docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRHandAimState

    XRHandAimState is a cross-platform struct representation of the MetaAimHand class to store all the state information related to hand aim on a per-frame basis.

    Implements
    IEquatable<XRHandAimState>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Hands
    Assembly: Unity.XR.Hands.dll
    Syntax
    [Serializable]
    public struct XRHandAimState : IEquatable<XRHandAimState>

    Properties

    handedness

    Denotes which hand this XRHandAimState is associated with.

    Declaration
    public readonly Handedness handedness { get; }
    Property Value
    Type Description
    Handedness

    If this was retrieved from a valid source, such as a successful call to XRHandCaptureFrame.XRHandCaptureFrame.TryGetAimState, this can only ever be Left or Right.

    indexPressed

    Whether the index finger and thumb are currently pressed together.

    Declaration
    public readonly bool indexPressed { get; }
    Property Value
    Type Description
    bool

    isTracked

    Whether the hand is currently tracked.

    Declaration
    public readonly bool isTracked { get; }
    Property Value
    Type Description
    bool

    littlePressed

    Whether the little finger and thumb are currently pressed together.

    Declaration
    public readonly bool littlePressed { get; }
    Property Value
    Type Description
    bool

    middlePressed

    Whether the middle finger and thumb are currently pressed together.

    Declaration
    public readonly bool middlePressed { get; }
    Property Value
    Type Description
    bool

    pinchStrengthIndex

    The strength of the pinch between the index finger and thumb. Ranges from 0.0 to 1.0.

    Declaration
    public float pinchStrengthIndex { get; }
    Property Value
    Type Description
    float

    pinchStrengthLittle

    The strength of the pinch between the little finger and thumb. Ranges from 0.0 to 1.0.

    Declaration
    public float pinchStrengthLittle { get; }
    Property Value
    Type Description
    float

    pinchStrengthMiddle

    The strength of the pinch between the middle finger and thumb. Ranges from 0.0 to 1.0.

    Declaration
    public float pinchStrengthMiddle { get; }
    Property Value
    Type Description
    float

    pinchStrengthRing

    The strength of the pinch between the ring finger and thumb. Ranges from 0.0 to 1.0.

    Declaration
    public float pinchStrengthRing { get; }
    Property Value
    Type Description
    float

    reserved0

    Reserved.

    Declaration
    public readonly int reserved0 { get; }
    Property Value
    Type Description
    int

    reserved1

    Reserved.

    Declaration
    public readonly int reserved1 { get; }
    Property Value
    Type Description
    int

    ringPressed

    Whether the ring finger and thumb are currently pressed together.

    Declaration
    public readonly bool ringPressed { get; }
    Property Value
    Type Description
    bool

    trackingState

    Determines which properties of the hand are being tracked as per InputTrackingState.

    Declaration
    public readonly InputTrackingState trackingState { get; }
    Property Value
    Type Description
    InputTrackingState

    Methods

    Equals(object)

    Tests for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare against.

    Returns
    Type Description
    bool

    Returns true if obj is of type XRHandAimState and Equals(in XRHandAimState) also returns true; otherwise returns false.

    Overrides
    ValueType.Equals(object)

    Equals(in XRHandAimState)

    Tests for equality.

    Declaration
    public bool Equals(in XRHandAimState other)
    Parameters
    Type Name Description
    XRHandAimState other

    The XRHandAimState to compare against.

    Returns
    Type Description
    bool

    Returns true if every field in other is equal to this XRHandAimState. Returns false otherwise.

    GetHashCode()

    Computes a hash code from all fields of this XRHandAimState.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    Returns a hash code of this object.

    Overrides
    ValueType.GetHashCode()

    TryGetAimPose(out Pose)

    Attempts to retrieve the aim Pose.

    Declaration
    public bool TryGetAimPose(out Pose aimPose)
    Parameters
    Type Name Description
    Pose aimPose

    If TryGetAimPose returns true, this will be filled out with a valid aim Pose.

    Returns
    Type Description
    bool

    Returns true if the pose was successfully retrieved. Otherwise, this returns false, and you should not use the resulting pose.

    Operators

    operator ==(in XRHandAimState, in XRHandAimState)

    Tests for equality. Same as Equals(in XRHandAimState).

    Declaration
    public static bool operator ==(in XRHandAimState lhs, in XRHandAimState rhs)
    Parameters
    Type Name Description
    XRHandAimState lhs

    The left-hand side of the comparison.

    XRHandAimState rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    Returns true if lhs is equal to rhs, otherwise returns false.

    operator !=(in XRHandAimState, in XRHandAimState)

    Tests for inequality. Same as !Equals(in XRHandAimState).

    Declaration
    public static bool operator !=(in XRHandAimState lhs, in XRHandAimState rhs)
    Parameters
    Type Name Description
    XRHandAimState lhs

    The left-hand side of the comparison.

    XRHandAimState rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    Returns true if lhs is not equal to rhs, otherwise returns false.

    Implements

    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2026 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)