docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Query microgestures

    Learn how to query microgestures from the XR Hands subsystem.

    Microgestures are small thumb motions, such as swiping or tapping the thumb against the side of the index finger.

    Requirements

    To use microgestures on OpenXR, your project must meet the following requirements:

    • The OpenXR Plugin package version 7.0.0-pre.1 or newer.
    • The following OpenXR features, enabled in the Edit > Project Settings > XR Plug-in Management > OpenXR window:
      • Hand Tracking Subsystem
      • Hand Interaction Profile
      • Hand Interaction Profile Microgestures

    These requirements apply in both XRHandDevice configuration modes. The Meta Hand Tracking Aim OpenXR feature doesn't provide microgestures.

    Changes to the enabled features apply the next time you enter Play mode or launch the application.

    Check microgesture support

    The XRHandSubsystemDescriptor.supportsMicrogestures property indicates whether the provider can supply microgestures. On OpenXR, this property is true when your project meets the requirements.

    When the provider doesn't support microgestures, all microgesture queries return false and the subsystem doesn't raise the microgestureUpdated event.

    Microgesture types

    The XRHandMicrogesture enum identifies each microgesture.

    Value Microgesture
    None No microgesture. Queries for this value always return false.
    SwipeLeft A thumb swipe to the left.
    SwipeRight A thumb swipe to the right.
    SwipeForward A thumb swipe forward.
    SwipeBackward A thumb swipe backward.
    TapThumb A thumb tap.

    Query microgesture state

    Each hand has its own XRCommonHandGestures instance. Get it from the XRHandSubsystem through leftHandCommonGestures, rightHandCommonGestures, or GetCommonGestures. Refer to Access hand data: Get the XRHandSubsystem instance to learn how to get the subsystem.

    XRCommonHandGestures provides the following methods to query a microgesture.

    Method Returns
    IsMicrogestureActive true when the runtime recognizes the microgesture, as of the latest dynamic update.
    WasMicrogesturePerformedThisFrame true if the microgesture became active in the latest dynamic update.
    WasMicrogestureCompletedThisFrame true if the microgesture became inactive in the latest dynamic update.

    Only dynamic updates (XRHandSubsystem.UpdateType.Dynamic) change the results of these methods. Before-render updates don't change them. By default, the subsystem runs one dynamic update per frame, so ThisFrame in the method names refers to that update.

    All three methods return false for XRHandMicrogesture.None and for values not defined in the enum.

    Respond to microgesture changes

    The microgestureUpdated event of XRCommonHandGestures is raised at most once per dynamic update, and only in an update where one or more microgestures become active or inactive.

    The event passes a MicrogestureUpdatedEventArgs object, which exposes the following properties:

    • handedness and commonGestures, which identify the hand and its XRCommonHandGestures instance.
    • Three properties for each microgesture, with the same meaning as the query methods. For example, swipeLeftActive, swipeLeftPerformedThisFrame, and swipeLeftCompletedThisFrame.
    Note

    The MicrogestureUpdatedEventArgs instance is valid only while the event is invoked, so don't keep a reference to it.

    Input System controls

    The <XRHandDevice> input device also exposes microgestures as Input System controls. Refer to XR Hand Device: Microgestures.

    Limitations

    XR Hand Capture recordings don't include microgesture data.

    Additional resources

    • XR Hand Device
    • Access hand data
    • OpenXR Hand Interaction Profile
    • Implement a provider
    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)