docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRSelectInteractableExtensions

    Extension methods for IXRSelectInteractable.

    Inheritance
    object
    XRSelectInteractableExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Interactables
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
    public static class XRSelectInteractableExtensions

    Methods

    GetOldestInteractorSelecting(IXRSelectInteractable)

    Gets the oldest interactor currently selecting this interactable. This is a convenience method for when the interactable does not support being selected by multiple interactors at a time.

    Declaration
    public static IXRSelectInteractor GetOldestInteractorSelecting(this IXRSelectInteractable interactable)
    Parameters
    Type Name Description
    IXRSelectInteractable interactable

    The interactable to operate on.

    Returns
    Type Description
    IXRSelectInteractor

    Returns the oldest interactor currently selecting this interactable.

    Remarks

    Equivalent to interactorsSelecting.Count > 0 ? interactorsSelecting[0] : null

    See Also
    interactorsSelecting

    IsSelectedByLeft(IXRSelectInteractable)

    Gets whether the interactable is currently being selected by an interactor associated with the left hand or controller.

    Declaration
    public static bool IsSelectedByLeft(this IXRSelectInteractable interactable)
    Parameters
    Type Name Description
    IXRSelectInteractable interactable

    The interactable to operate on.

    Returns
    Type Description
    bool

    Returns true if any interactor currently selecting this interactable has handedness of Left.

    Remarks

    This method will return true even if it is not exclusively being selected by the left hand or controller. In other words, it will still return true if the interactable is also being selected by an interactor associated with the right hand or controller.

    See Also
    IsSelectedByRight(IXRSelectInteractable)
    handedness

    IsSelectedByRight(IXRSelectInteractable)

    Gets whether the interactable is currently being selected by an interactor associated with the right hand or controller.

    Declaration
    public static bool IsSelectedByRight(this IXRSelectInteractable interactable)
    Parameters
    Type Name Description
    IXRSelectInteractable interactable

    The interactable to operate on.

    Returns
    Type Description
    bool

    Returns true if any interactor currently selecting this interactable has handedness of Right.

    Remarks

    This method will return true even if it is not exclusively being selected by the right hand or controller. In other words, it will still return true if the interactable is also being selected by an interactor associated with the left hand or controller.

    See Also
    IsSelectedByLeft(IXRSelectInteractable)
    handedness

    See Also

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