Interface IXRHapticImpulseChannel
An interface that allows for sending haptic impulses to a channel on a device.
Namespace: UnityEngine .XR.Interaction.Toolkit.Inputs.Haptics
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public interface IXRHapticImpulseChannel
Methods
SendHapticImpulse(float, float, float)
Sends a haptic impulse on the device if it supports sending a haptic impulse.
Declaration
bool SendHapticImpulse(float amplitude, float duration, float frequency = 0)
Parameters
Type | Name | Description |
---|---|---|
float | amplitude | The desired motor amplitude that should be within a [0-1] range. |
float | duration | The desired duration of the impulse in seconds. |
float | frequency | The desired frequency of the impulse in Hz. A value of 0 means to use the default frequency of the device. |
Returns
Remarks
This method considers sending the haptic impulse a success (and thus returns true)
if the haptic impulse was successfully sent to the device even if frequency is ignored or not supported by the device.
Frequency is currently only functional when the OpenXR Plugin (com.unity.xr.openxr) package is installed
and the input action is using an input binding to a Haptic Control.