question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble with haptic feedback on different controllers

See original GitHub issue

I’m trying to add a custom haptic feedback to my controller script with custom SteamVR Input bindings. I copied the following from SteamVR’s Hand.cs code to my own controller class:

    using Valve.VR;

    public SteamVR_Input_Sources HandType;
    public SteamVR_Action_Vibration HapticAction;

    public void TriggerHapticPulse(float duration, float frequency, float amplitude)
    {
        HapticAction.Execute(0, duration, frequency, amplitude, HandType);
    }

and called it in another function: TriggerHapticPulse(1.0f, 150.0f, 75.0f);. But upon running the game I get an error: TriggerHapticVibrationAction (/actions/Custom/out/HapticFeedback) error: InvalidHandle handle: 1152970243895722447. I have checked and made sure that my custom SteamVR input bindings are generated, bound and saved using the binding UI. public SteamVR_Action_Vibration HapticAction; is set to: \actions\Custom\out\HapticFeedback. public SteamVR_Input_Sources HandType; is set to (for this example): Left Hand. I have SteamVR_ActivateActionSetOnLoad set to my custom \actions\Custom action set.

I’m using the latest SteamVR Beta 1.2.3 on Unity 2018.3.0f2, with OpenVR 1.0.2 installed in the unity package manger.

I’ve changed SteamVR_Action_Vibration’s error logError to LogWarning for now so my whole script doesn’t break apart.

I can provide more information if needed. I’m still really new to SteamVR 2.0 so ask me to check stuff I might or might not have on my CameraRig that might be doing this.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:24

github_iconTop GitHub Comments

1reaction
Tbernard33commented, Apr 4, 2019

Luckily is found my mistake today. It does not make much sense and I don’t think it’s related to your problem so excuse me for spamming your topic.

My problem came from the duration limit value accepted by the oculus Rift.

The duration value must be lower than 0.79f…

m_HapticAction.Execute(0f, duration, frequency, amplitude, source);

This works : m_HapticAction.Execute(0f, 0.5f, 150, 75, SteamVR_Input_Sources.LeftHand);

This don’t : m_HapticAction.Execute(0f, 0.8f, 150, 75, SteamVR_Input_Sources.LeftHand);

0reactions
RedKrakenStudioscommented, Mar 8, 2020

Here is another strange issue with haptics: SteamVR 2.0 Oculus Rift S (touch controllers) Unity 2019.2.17 I am executing haptics using the TriggerHapticPulse() on the Hand. If I reload the scene (destroying the player) the “sourceMap” for SteamVR_Action_Vibration is null and throwing lots of errors. This only happens on reload or scene changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Haptic Feedback vibrations only working on one side on PC?
UPDATE: I fixed it, turns out the issue was having the controller plugged into the wrong USB port! Now it's plugged into the...
Read more >
Weird issue when using haptics on both Touch controllers
One issue, however, we are having is that if haptic feedback is active on both controllers at the same time it acts pretty...
Read more >
PS5 haptic feedback not working fix
From the PS5 home screen, navigate to “Settings” in the top right. · Select the “Accessories” option. · Select the “Controllers” option. ·...
Read more >
Re: PS5 controller haptic feedback issues on PS5 - Answers HQ
I have rebooted the game rebooted the ps5 and checked for updates for both the dual sense and the ps5 itself. I even...
Read more >
No haptic feedback on VR Controllers when rotating knobs ...
Rotating controls and flipping switches does not provide haptic “clicks”. There is no haptic feedback on rotation “clicks” (see X-Plane ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found