Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Resolved Gripforce / Valve Index Input Issues

Discussion in 'VR' started by yarsrvenge, Jan 13, 2022.

  1. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    I am unable to get a Press Point to work with gripforce on the knuckles. I can manually read the value through code, but the input system press point is not working. Resorting to doing this manually would cause a lot of hoops to jump through.

    Has anyone been able to use a press point with gripforce on OpenXR?
     
  2. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    So, I resolved this but thought I would share how I handled it. Not sure it is the best way. Bottom line, I needed to base the SELECT input action on INDEX controllers using grip force while also allowing regular grip for other XR controllers. Whenever I added that under the select action along with other generic XR controller bindings it did not work correctly. Basically, the grip pressure and grip were reported as one value and it was always 0 or 1.

    To solve this, I created a new control scheme just for Index controllers. The problem is it won't just automatically use that control scheme, so whenever controller devices are added I check if it is an index controller and if so I setup a mask on the inputactionsasset to only use the Index control scheme.

    Might be a better way but I could not find one.
     
  3. kallemax

    kallemax

    Joined:
    Nov 26, 2018
    Posts:
    1
    Turns out, one and a half year later this problem still persists. I also need a special "hard squeeze" function on Index, so it will work alongside normal grabbing of objects, but is not triggered accidentally all the time. So I added GripForce actions in the GameInputActions, but the returned value was always 1. Thanks to the advice from user yarsrevenge, I figured out that I "only" need to disable my "special grip actions" for the leftHand and rightHand XRcontrollers, in case it's detected that the player is using Knuckles controllers. The special actions for the Knuckles GripForce can always stay on, so it's not as much switching around as I initally thought.
    You can disable individual GameInputAction by using
    _gameInputActions = new GameInputActions();
    _gameInputActions.LeftHand.YourGameInputActionsName.Disable();
    as an example. I hope this helps, took me ages to finally figure it out :p
     
  4. VirtualDestructor

    VirtualDestructor

    Joined:
    May 3, 2014
    Posts:
    45
    Ok, I recently ran into this same issue. The grip pressed action was firing every time I touched the controller. Now I just check the "grip force" which is specific to the index, and on all other platforms I just read "grip pressed". It's frustrating that we need a separate code path for the Valve Index. I've attached an image with my input settings.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      97 KB
      Views:
      86
  5. sherod

    sherod

    Joined:
    Jan 23, 2020
    Posts:
    4
    For some reason "gripForce" doesnt show up at all in my list. Did you have to do anything special to get it to show up?