The Meta XR plugin supports three haptics blueprints under the Game Feedback category:
Set Haptics by Value
Stop Haptic Effect
Play Haptic Effect
Set Haptics by Value blueprint
This blueprint redirects to Simple Haptics. The haptic location defaults to hand. Use the Set Haptics by Value blueprint to start and stop haptics for a controller.
To start, update, or end vibration, call Set Haptics by Value in the frame where you want to make the change and define the frequency and amplitude of the haptic response.
Expected values for amplitude and frequency are any value between 0-1, inclusive. The greater the value, the stronger or more frequent the vibration in the controller. To end the vibration, set both Amplitude and Frequency to 0. Controller vibration automatically ends 2 seconds after the last input. For more information, see Set Haptics by Value in the Unreal documentation.
Stop Haptic Effect blueprint
This blueprint redirects to Simple Haptics. Haptic location defaults to hand. Use this blueprint to stop haptics for a controller. As with the Set Haptics By Value blueprint, you end the vibration by setting both Amplitude and Frequency to 0.
For more information, see Stop Haptic Effect in the Unreal documentation.
Play Haptic Effect blueprint
Use this blueprint to send a specified haptic curve to the controller. For more information, see Play Haptic Effect in the Unreal documentation.
This blueprint can be configured to play haptic waves based on input. For input options, right-click the content browser to bring up the context menu, select Miscellaneous, and then select one of the following three options:
Haptic Feedback Buffer: Plays a buffer of bytes 0-255. In this case, Play Haptic Effect redirects to Simple Haptics. Haptic location defaults to hand. Haptics is triggered in each frame with the corresponding amplitude whose time is closest to the frame time.
Haptic Feedback Curve: Draw the haptic linear curve you wish to play using the Haptic Curve Editor. In this case, Play Haptic Effect redirects to Simple Haptics. Haptic location is defaulted to hand. Haptics is triggered in each frame with the corresponding amplitude sampled with time.
Haptic Feedback Soundwave: Select a mono audio file to be converted into a haptic effect of corresponding amplitude. In this case, Play Haptic Effect redirects to PCM Haptics. Append defaults to False.
Example
The following blueprint illustrates a simple haptics sequence on the Meta Quest Touch controller using Play Haptic Effect. This example sends vibrations using Play Haptic Effect when the left controller grab is pressed. When the button is released, Stop Haptic Effect sends a stop command to the Touch controller.
When the left controller trigger is pressed, a constant vibration is sent by Set Haptics by Value until the button is released.
We have added eight Blueprints to the Meta XR Plugin under Oculus Library > Controller. Unreal Engine redirects each Blueprint to a specific Meta Quest Touch haptics function explained below.
Set Haptics by Value: This blueprint redirects to Simple Haptics. Haptic location is added compared with Set Haptic By Value.
Stop Haptic Effect: This blueprint redirects to Simple Haptics. Haptic location is added compared with Stop Haptic Effect.
Play Buffer Haptic Effect: This blueprint redirects to Simple Haptics. Only Haptic Feedback Buffer can be used as Haptic Effect. Haptic location is added compared with Play Haptic Effect with Haptic Feedback Buffer as Haptic Effect. Haptics is triggered in each frame with the corresponding amplitude whose time is closest to the frame time.
Play Amplitude Envelope Haptic Effect: This blueprint redirects to Amplitude Envelope. Only Haptic Feedback Buffer can be used as Haptic Effect. All data will be sent to the controller with one shot.
Play Curve Haptic Effect: This blueprint redirects to Simple Haptics. Only Haptic Feedback Curve can be used as Haptic Effect. Haptic location is added compared with Play Haptic Effect with Haptic Feedback Curve as Haptic Effect. Haptics is triggered in each frame with the corresponding amplitude sampled with time.
Play Sound Wave Haptic Effect: This blueprint redirects to PCM Haptics. Only Haptic Feedback Sound Wave can be used as Haptic Effect. Append is added compared with Play Haptic Effect with Haptic Feedback Sound Wave as Haptic Effect.
Get Max Haptics Duration: This blueprint is to get the maximum sample data measured with duration (in seconds) which could be sent to the controller. Extra data will be discarded and an Unreal Engine error message will be logged.
Get Controller Sample Rate: This blueprint redirects to native documents which returns the controller’s current sample rate.