Closed nezix closed 3 years ago
@nezix Simply update your haptic API to TriggerHapticVibration. The warning spam message is because ThumbTouch and IndexTouch features not supported. If you don't want to see the warning messages, please modify the script as follows,
In Assets\HTC.UnityPlugin\VRModule\Modules\UnityXRModule.cs, line 671,
bool thumbrest = GetDeviceFeatureValueOrDefault(device, new InputFeatureUsage<bool>("Thumbrest"));
//float indexTouch = GetDeviceFeatureValueOrDefault(device, new InputFeatureUsage<float>("IndexTouch"));
//float thumbTouch = GetDeviceFeatureValueOrDefault(device, new InputFeatureUsage<float>("ThumbTouch")); // Not in use
state.SetButtonTouch(VRModuleRawButton.Touchpad, thumbrest);
//state.SetButtonTouch(VRModuleRawButton.Trigger, indexTouch >= 1.0f);
if ((device.characteristics & InputDeviceCharacteristics.Left) != 0)
{
bool menuButton = GetDeviceFeatureValueOrDefault(device, CommonUsages.menuButton);
state.SetButtonPress(VRModuleRawButton.System, menuButton);
}
I will fix the TriggerHapticPulse API later, thanks!
Thanks for your answer,
I tried to replace ViveInput.TriggerHapticPulse(HandRole.LeftHand, 500);
by ViveInput.TriggerHapticVibration(HandRole.LeftHand);
but no luck on my part.
If I directly call OVRInput.SetControllerVibration(0.9f, 0.5f, OVRInput.Controller.RTouch);
the right controller vibrates.
@nezix I use ViveInput.TriggerHapticVibration(HandRole.LeftHand, 500); Could you try this?
I tried this too, same result. Is there something I am missing ?
Where did you attach your script to? The vibration is kinda weak for the value 500.
I deleted and recreated an empty project and follow the first post recipe and it works now with TriggerHapticVibration
...
Weird !
Sorry for the waste of time.
@nezix No worries. Let me know if you still have questions, cheers! I will update the TriggerHapticPulse API later.
Haptic feedback does not work for Oculus rift controllers when not using SteamVR, calling TriggerHapticPulse does not make the controllers vibrate.
This works using SteamVR but not using the Oculus runtime.
I also have this warning spammed: