Search Unity

Question Weird haptic event on trigger/grip button press

Discussion in 'VR' started by emrys90, Jun 3, 2021.

  1. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I updated to Unity 2020.3 from 2019.4, and updated to the latest version of XR Interaction Toolkit plus switched over to OpenXR. Now whenever I press the trigger and grip buttons on my controllers, without even interacting with any objects, I get slight haptic events. Haven't been able to figure out how to fix it. The haptic events on the XR interactors aren't enabled, so I have no idea what's going on. Does anyone know how to fix this?
     
  2. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    What scene are you using?
     
  3. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I'm not sure I understand your question. It's my own game scene, not a demo scene, if that's what you mean.
     
  4. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Is it something you would be willing to send me to try? You can package up everything but the library folder if you want to. Otherwise all I can suggest would be to disable as much as you can until it stops happening.
     
  5. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    So as far as you're aware then, this isn't some default setting with OpenXR or XR Interaction Toolkit? I've done a search of the code base for haptics and it's definitely not something in my own code triggering it
     
  6. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Not that I am aware of, I do not have a lot of XRI experience though so let me send this over to someone who does. With OpenXR specifically you would need to trigger the haptic intentionally in some way to make it happen. Unless the runtime were doing it for some reason, what device and runtime are you using?
     
  7. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Thanks! And yeah, its a very strange issue. I haven't been able to find any code triggering it. Did a search of haptics in my own code base (I only have 3 places I'm currently using haptics), searched through the XR Interaction Toolkits code but couldn't find anything there either.

    I'm using an Oculus Quest through Oculus Link with SteamVR as the OpenXR provider. I've had the issue confirmed by another playing my game using a Valve Index as well.
     
  8. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I took some time this morning to try this out both using the XRI sample project and the OpenXR Controller sample. In both cases when using Oculus / SteamVR OpenXR Runtime I did feel the haptic impulse and that impulse was not being sent from unity. I verified this by debugging the OpenXR plugin and making sure the OpenXR API haptic API was not being called. I further tested to make sure this does not happen with Oculus / Oculus OpenXR Runtime and it does not. I reported the issue to valve this morning and linked in this forum post as well and will let you know what I found out on that front. Stay tuned.
     
  9. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Thank you!
     
  10. runeberg-valve

    runeberg-valve

    Joined:
    Jan 28, 2020
    Posts:
    34
    Hi,

    We do introduce a "haptic bump" once you hit an axis threshold when using our runtime. We feel it's a useful/helpful cue for users on when the trigger/grip action is actually activated.

    We are also working on an OpenXR extension that'll give application developers more control over this haptic bump and axis thresholds. But for the meantime, this is a standard feature we'd be keeping in our runtime regardless of controller hardware in use.

    Cheers,
    Rune
     
    the_real_apoxol likes this.
  11. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    That axis threshold is going to be different per game, and from my players I have received feedback that it is not a desired feature. It seems quite odd for it to be a default on with no option to turn it off and "breaks" all games that switch over to OpenXR.
     
  12. runeberg-valve

    runeberg-valve

    Joined:
    Jan 28, 2020
    Posts:
    34
    Hi @emrys90 - the trigger click action we supply should be the same across all titles. are you supplying your own trigger action based on a specific axis threshold? If so, may we know why? If there's a way we could improve the axis->button binding it'd be good to know.

    On the balance however, in the absence of the extension I mentioned in my first reply, we had to make a decision on the default for our OpenXR implementation and felt with available data, we should keep the haptic bump on.

    If this interferes with your title and any upcoming release dates, the best option is to stay with SteamVR Input for now, where you are able to control these thresholds until an OpenXR extension is released and we've had time to implement it.
     
  13. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    My game is cross platform with Oculus Quest, so using SteamVR Input was never a good option for us. I was using the legacy OpenVR in 2019.4, but it does not support the Index controllers.

    I started with using the default OpenXR input bindings for trigger and grip buttons, but players with an Index during playtesting said that the grip button was far too sensitive, and the trigger button not sensitive enough, so I had to change them to custom values. Whether that is different than your thresholds or not I am not aware.

    As to why thresholds can be different per game though, consider games that can do different actions based on the strength of a grip, or how far the trigger is pulled. It doesn't apply to my game, but there are definite use cases for it.
     
  14. runeberg-valve

    runeberg-valve

    Joined:
    Jan 28, 2020
    Posts:
    34
    Thanks for the feedback @emrys90. It's one of the reasons we provide more granular control with SteamVR Input. Unfortunately it's the only viable option we have at the moment if you wish this level of control for your title.

    The extension is still being worked on as I mentioned and as such, I wouldn't rely on its immediate release. I have bookmarked this thread and will let you know once its out and implemented.
     
  15. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Okay, thank you.
     
  16. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    501
    Just ran into this as well. While I appreciate the thought of having a haptic click on the Knuckles to let users know they've triggered something, it's also unfortunate that it can't be turned off. I have a beta tester with a hand injury, and he absolutely can not play a VR game with any haptic feedback, no matter how little. The hard coded haptic feedback makes my game, as well as any other game using OpenXR, entirely unplayable for him, and anyone else with a hand injury or carpal tunnel (which is triggered by vibration). The haptics cause him a lot of pain and make his hands unusable for up to a week. I don't think that's something we want as the default for all upcoming OpenXR titles. Can you please reconsider having the hard coded haptic, @runeberg-valve? It's easy enough to trigger it manually. I can't revert back to using SteamVR, because I'm developing cross platform.

    Alternatively, exposing in the Steam VR interface an option to kill all haptics would be fine as well - if not even preferable. That would allow for a unified haptic tick across all titles on Steam VR hardware, while giving those sensitive to haptics the option to switch it off, regardless of whether the developer included the option to.
     
    Last edited: Jun 8, 2021
  17. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Is Vermillion your app you made that is using OpenXR? Regardless, looks awesome, nice job!
     
    Thomas-Mountainborn likes this.
  18. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    501
    Indeed it is, thanks!
     
    the_real_apoxol likes this.
  19. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Very cool, will post on our internal OpenXR team channel :)
     
    Thomas-Mountainborn likes this.
  20. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Is there any update on this? Noticing it occurring with the latest (1.2.8). We are also doing a cross platform game, and use haptics for specific user feedback (when they take damage, etc) and this interferes with that design, making us unable to use OpenXR.

    Ideally it would just be disabled by default, since then developers could decide case by case whether a haptic feedback on trigger click is appropriate, since implementing a haptic impulse on trigger click is very straightforward.
     
    Last edited: Aug 28, 2021
  21. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Last I heard, we're still waiting on Valve to make an OpenXR extension to allow us to disable it. It is very frustrating, I very much dislike the haptic events, as do my players.
     
  22. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Is there a reason given to not just disable it entirely by default, then have an extension to enable it? I'm just not sure I understand why it is a default, since this is very easy for developers to implement themselves if they think it fits their interactions.
     
  23. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I completely agree. Unfortunately, it seems like something that is entirely on Valve's end, so not something Unity can do anything about.
     
    Iron-Warrior likes this.
  24. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    501
    Also still waiting on this. To me it makes no sense to take control away from the developers on something so core to the player's experience.
     
  25. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Okay, so according to the SteamVR 1.19 release notes, they have
    In theory could we just set the threshold to be something like 2, so that it never gets passed and the haptic never triggers? For extensions, Khronos states that
    Is this something Unity's OpenXR implementation supports?

    EDIT: Here's the full description of the extension.

    ANOTHER EDIT: Guessing that OpenXR features are how we interact with extensions?
     
    Last edited: Aug 29, 2021
  26. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Correct, you would need to implement an OpenXR feature to add this extension, or valve would.
     
  27. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Okay great, I've got a feature set up. It looks like I will need to make some calls to the native OpenXR API (adding an XrInteractionProfileAnalogThresholdVALVE structure to the XrInteractionProfileSuggestedBinding chain)—are there any examples of interfacing with the native OpenXR API? I'm guessing it would be called in the OnInstanceCreate method in the feature.
     
  28. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Iron-Warrior likes this.
  29. ThatRaincoat

    ThatRaincoat

    Joined:
    Jul 12, 2017
    Posts:
    27
    Any updates on this?

    We are currently switching to OpenXR and we'd prefer to use our own haptic values per input as the trigger and grip have a different game actions detecting on context.

    Additionally we have different thresholds set for the grip and trigger that don't align with where the haptic pulses occur.
     
    Last edited: Oct 5, 2021
  30. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    No updates on our side as this is an issue specific to the Steam VR runtime. As discussed above there is a extension that valve has created that should work around this issue but not sure if anyone has implemented it yet.