# OpenXR > Haptics

Source: https://docs.manus-meta.com/3.2.1/Plugins/OpenXR/Haptics/

> **Warning: License requirement**
>
> The functionality described requires a `MANUS Bodypack` or a `MANUS license key` with the `OpenXR` feature enabled.

OpenXR does not natively support finger haptics for glove devices. To enable haptics for finger tracking, the MANUS OpenXR API Layer provides an extension to enable the use of finger haptics. This article explains how to implement finger haptics in OpenXR applications.

## Prerequisites

Please make sure to have read the getting started guide for the MANUS OpenXR API Layer. Make sure it's installed and functional. For more information, please refer to the [Getting Started](https://docs.manus-meta.com/3.2.1/Plugins/OpenXR/Getting%20Started/index.md) guide.

## Implementation

The feature is modeled after the [xrApplyHapticFeedback](https://registry.khronos.org/OpenXR/specs/1.1/man/html/xrApplyHapticFeedback.html) function in the OpenXR API, intended for input devices. The MANUS OpenXR API Layer provides a function to apply haptic feedback to the fingers of the glove devices. The function is called `xrApplyHapticFeedbackMANUS`.

The xrApplyHapticFeedbackMANUS function is defined as:

*Functions*

```C++
XrResult xrApplyHapticFeedbackMANUS(XrSession session,
                                    XrDuration duration,
                                    XrHandEXT side,
                                    XrMANUSFingerAmplitudes amplitudes);

typedef struct XrMANUSFingerAmplitudes {
    float thumb;
    float index;
    float middle;
    float ring;
    float pinky;
} XrMANUSFingerAmplitudes;
```

### Parameters

- `session` is the [XrSession](https://registry.khronos.org/OpenXR/specs/1.1/man/html/XrSession.html) to start outputting to.
- `duration` is the [XrDuration](https://registry.khronos.org/OpenXR/specs/1.1/man/html/XrDuration.html) of the haptic feedback in nanoseconds.
- `side` is the [XrHandEXT](https://registry.khronos.org/OpenXR/specs/1.1/man/html/XrHandEXT.html) to apply the haptic feedback to.
- `amplitudes` is the XrMANUSFingerAmplitudes struct containing the amplitude for each finger in a range from 0.0 to 1.0.

### Description

Trigger a haptic event on the specified hand with the specified duration and amplitude for each finger. The amplitude is a float value between 0.0 and 1.0, where 0.0 is no haptic feedback and 1.0 is the maximum haptic feedback.

If another haptic event for the same hand is happening when this function is called, the new event will override the old event.

## Unity

For Unity, haptics can be added through OpenXR by making use of our `OpenXRUnityHaptics` Unity package. This package can be found as part of our [Unity Plugin](https://my.manus-meta.com/resources/downloads/overview).

Import the `OpenXRUnityHaptics` Unity package into your project.

![](https://docs.manus-meta.com/3.2.1/Plugins/OpenXR/assets/image-10.png)

Enable the `MANUS Haptics Extension` in `Edit->Project Settings->OpenXR`.

![](https://docs.manus-meta.com/3.2.1/Plugins/OpenXR/assets/image-11.png)

The unitypackage includes `MANUSOpenXRHapticsSample.cs` as an example demonstrating how to call our haptics function.

Get the `MANUSOpenXRHapticsFeature` from the OpenXRSettings.

```C++
private MANUSOpenXRHapticsFeature m_MANUSOpenXRHapticsFeature;

private void Start()
{
    m_MANUSOpenXRHapticsFeature = OpenXRSettings.Instance.GetFeature<MANUSOpenXRHapticsFeature>();
}
```

The Haptics can now be activated through `VibrateHand`.

```C++
m_MANUSOpenXRHapticsFeature.VibrateHand(-1, XrHandEXT.XR_HAND_RIGHT_EXT, new FingerAmplitudes(1, 1, 1, 1, 1));
```

This function has the following parameters:

- `p_Duration` is the duration of the vibration in nanoseconds. The shortest duration we support at this time is 50000000 nanoseconds (50ms). Alternatively, -1 can be used to vibrate the shortest duration possible.
- `p_Side` is the side of the hand to vibrate.
- `p_Amplitudes` is the intensity of the vibration per finger. We support values between 0 (no vibration) and 1 (maximum vibration).
