Does Unity3D not support haptics/rumble with OpenXR yet?
Using non-OpenXR loaders rumble works fine. Try to use OpenXR and rumble no longer works.
Does Unity3D not support haptics/rumble with OpenXR yet?
Using non-OpenXR loaders rumble works fine. Try to use OpenXR and rumble no longer works.
The following is a link to a forum post I made today with more information and a work around until we release the next version of the OpenXR plugin.
Unity support for OpenXR in preview page-5#post-7046953
Thanks a lot for this!
I made this class using your script. Hope it helps someone easily call haptic.
public class HapticPlayer
{
public enum Hand
{
Both,
Left,
Right
}
public static void SendHaptic_XRController(Hand hand, float amplitude, float duration)
{
switch (hand)
{
case Hand.Both:
SendHaptic(XRController.leftHand, amplitude, duration);
SendHaptic(XRController.rightHand, amplitude, duration);
break;
case Hand.Left:
SendHaptic(XRController.leftHand, amplitude, duration);
break;
case Hand.Right:
SendHaptic(XRController.rightHand, amplitude, duration);
break;
default:
break;
}
}
public static void SendHaptic(InputDevice device, float amplitude, float duration, int channel = 0)
{
if (device != null)
{
var command = UnityEngine.InputSystem.XR.Haptics.SendHapticImpulseCommand.Create(channel, amplitude, duration);
device.ExecuteCommand(ref command);
}
}
}
Also here are haptics and input working in a simple way for many devices.
https://github.com/VRStudios/Unity3D-XRInput
The 1.3 release of the OpenXR plugin also has a new Haptic interface that lets you bind the haptic outputs as InputSystem actions and fire the haptics using the action. It will also support frequency as well as amplitude and duration. These new apis will provide better support for controllers with multiple haptics and more control over the haptic feeling.
this is great! Any idea when? Also, the above method, will that still be there? I can see cases where you’d need to call them via code.
No ETA yet
Hello thanks for the code. It works well.
I am wondering how to achieve continuous rumble only when specific button is being pressed e.g. grip?
i’ve tried to change to grip pressed action, but it only triggers once at a time and not continuous.
thanks in advance
D