Search Unity

Question SteamVR actions not firing consistently on some control inputs

Discussion in 'VR' started by Chimpien, Mar 1, 2023.

  1. Chimpien

    Chimpien

    Joined:
    Nov 8, 2018
    Posts:
    8
    I have a Vive Pro Eye (and have got the same behaviour on a standard Vive) and I recently changed the controller binding of 2 actions from one controller to the other and now one of them only works very occasionally; I definitely have the correct hand assigned as one of the actions in that script works, and the other works occasionally. The actions are bound to clicking directions on the D-pad, but click north is only triggering the action very rarely, though the other directions do work properly. In VR looking at my hand and controller it is clearly detecting my touch on the North of the d-pad, and sensing the click as the VR model of the controller shows the touch and button press. Binding one of the actions to the grip button it works fine, reverting back to the other hand also works fine. Binding a different action to click North I get the same behaviour - intermitent action triggering. SteamVR live input viewer shows the same behaviour, the action triggers occasionally. I can't figure out a consistent way of making the action work to connect the problem to anything in the scene. I have tested my controllers in the SteamVR controller test and they work fine there (and have switched hand assignment of the controllers, and tested with someone else's controller) so it is not a hardware issue. Does anyone have any suggestions what could be interfering with the action working?

    Unity 2021.3.13f1. SteamVR Plugin v2.7.3
     
  2. nilagard

    nilagard

    Joined:
    Jan 13, 2017
    Posts:
    77
    Could you provide some screencaps of what you are trying to bind? And how you bind it vs what is "out of the box" when it's standard.
     
  3. VRDave_Unity

    VRDave_Unity

    Unity Technologies

    Joined:
    Nov 19, 2021
    Posts:
    275
    Hey @Chimpien,
    From the way you describe this, I assume you are using the Input System package? Is there a way you could provide Input Action asset files or screenshots, as nilagard suggested? It's also important to understand which other XR packages you are using, so if you can list anything else that would be helpful (XR Management, OpenXR, XR Interaction Toolkit, etc). Since the SteamVR plugin is owned/maintained by Valve, I will also make sure they are aware of this post.
     
  4. runeberg-valve

    runeberg-valve

    Joined:
    Jan 28, 2020
    Posts:
    34
  5. Chimpien

    Chimpien

    Joined:
    Nov 8, 2018
    Posts:
    8
    Hi,

    Attached is screenshots of the binding UI and package list, and the script file containing the jump actions.

    As I explained the grip binding of the action works as expected, and when rebinding jump actions to the right d-pad the actions work as expected also (although the east and west actions are triggered accidentally a lot).
     

    Attached Files:

  6. Chimpien

    Chimpien

    Joined:
    Nov 8, 2018
    Posts:
    8
     
  7. nilagard

    nilagard

    Joined:
    Jan 13, 2017
    Posts:
    77
    I believe you are trying to bind this through the SteamVR bindings list, this ain't gonna work like you want it to. You have to programatically bind this inside Unity through either code or the XRAction assets. The way you are binding it now have nothing to do with the way it works with your scripts, it will always be in conflict with your scripts. I suggest reading/following a few VR guides on how to program/setup your VRControllers and buttons.
     
  8. runeberg-valve

    runeberg-valve

    Joined:
    Jan 28, 2020
    Posts:
    34
    Thanks for the update and screenshots.

    First off, you need to save your bindings as the default binding:

    (a) Click on "Replace Default Binding"
    (b) Click "Back"
    (c) Under "Official Bindings", click on "Activate" to make your edited bindings the default one for your project.
    (d) Click on "View" on the now "active binding" (this shouldn't be "local changes") to double check if your bindings have been properly saved and active.

    In your script, the action names doesn't seem to match the ones in the Binding UI, did you add the actions via the SteamVR Input Window? (Window > SteamVR Input)

    For step-by-step instructions on how to add bindings, you can refer to this documentation:
    https://valvesoftware.github.io/steamvr_unity_plugin/tutorials/SteamVR-Input.html#adding-an-action

    For dpad actions, you can fine tune them in the settings (gear icon):
    upload_2023-3-3_9-34-7.png

    Finally, this is the quick dpad test project I created using latest versions of our Unity XR plugin and Interactions/Input Plugin.
    https://www.dropbox.com/s/p6ailh8b0fv10g3/SteamVRInput.zip?dl=0

    Scene is: Assets > Steam VR > "Simple Sample (scene)"
    Script is here: Assets > SteamVR > Interaction System > Samples > Scripts > "Jump.cs"

    Note:
    The method I used in Jump.cs is not the only way to do it nor is it the recommended one - you'd have to judge which one works best for your project (other methods here: https://valvesoftware.github.io/ste...R-Input.html#working-with-actions-in-the-code)
     
    Last edited: Mar 2, 2023