Search Unity

Unity's new input system + Valve Index controllers

Discussion in 'AR/VR (XR) Discussion' started by AmbOcclusion, Sep 8, 2020.

  1. AmbOcclusion

    AmbOcclusion

    Joined:
    Sep 17, 2012
    Posts:
    33
    Hey all.

    I've spent a few days scratching my head trying to get the finger tracking on the Index to work. I'm not using SteamVR as I'm trying to make an SDK agnostic tool for Unity. I want the ability to track the player's fingers (index, middle, ring, pinky, thumb) all separately without importing the full SteamVR SDK(non-negotiable). I'm currently using Unity's new input system and I've gotten the triggers, thumbsticks, and buttons to all work but I cannot for the life of me get any readout from the finger tracking, despite them showing up in both the UI and the API (demonstration from another user here https://forum.unity.com/threads/new-input-system-knuckles-support.610624/#post-5391516). They all report as 0.

    I also tried to get inputs from the CommonUsages API but all of the finger readouts were 0 there as well.

    My next lead was to import just the OpenVR C# API and manually query the finger inputs but apparently playing with that too much interferes with Unity's controller bindings and the new input system stops working.

    I'm officially stumped and would love to know if anyone else has tackled this and can help me out. Thanks!
     
    FlightOfOne likes this.
  2. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
  3. AmbOcclusion

    AmbOcclusion

    Joined:
    Sep 17, 2012
    Posts:
    33
    I'm sorry but this doesn't really answer my question.
     
  4. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I am in the same boat as you and extremely frustrated to say the least. As the previous comment (probably the best answer you are going to get) said it simply won't work with the new input system. You will not be able to get any readings from any of the Steam controllers, not just Index. And if you do find a solution please do share.

    See here.
    https://github.com/ValveSoftware/unity-xr-plugin/issues/16

    I am currently looking at the Oculus plugin and I using my own wrapper for the game. So when things changes again, I don't have to touch my game code.

    There is also the XR Interaction Toolkit you can look into.
     
    Last edited: Sep 9, 2020
  5. AmbOcclusion

    AmbOcclusion

    Joined:
    Sep 17, 2012
    Posts:
    33
    The farthest I've gotten so far is to import the openvr_api and manually poll the inputs, but simply setting the action manifest is enough to kill all inputs going into the new input system. Even after that, I still was not able to get any inputs from the action I was feeding it.
     
  6. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I asked this earlier today, maybe someone will have a clever idea: https://forum.unity.com/threads/what-is-your-prefered-plugin-for-vr-pc-in-2019-4-lts.966973/

    I really want to use the new input system too and I was until Valve (or Unity?) decided not to support it. It was working just perfect. I thought all the troubles are behind me, but it was too good to be true. I just don't understand this...
     
  7. AmbOcclusion

    AmbOcclusion

    Joined:
    Sep 17, 2012
    Posts:
    33
    I'm focusing a lot of my effort on cleaning up my SDK-less asset for VR games so I can use it for future titles but Unity doesn't have solid support for every feature on every platform and the VR manufacturers are the ones who've taken it upon themselves to provide that functionality. It's just frustrating because I don't want to import massive, bloated SDKs into my project and have to maintain them and filter them out based on what platform I'm exporting to. I feel like at the very least Unity should support the features they expose in the API (all finger tracking is exposed but provide no input in Unity's new input system).
     
  8. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Isn't finger tracking grip just a touch pad and I think the buttons also have a touch sensor? Couldn't you use something like IK (or just use masked animations) to set finger tips to those positions? Probably going to take some work but at least there is a way.
     
  9. AmbOcclusion

    AmbOcclusion

    Joined:
    Sep 17, 2012
    Posts:
    33
    On Index the finger tracking is a little more nuanced than just touch. The controllers detect how much your fingers are wrapped around the controllers and report appropriate values. So you can lightly clasp your hand and the fingers won't be all the way curled in the game world. I want to include this much detail in my asset because it makes the difference when it comes to grabbing objects with just the finger tracking.
     
    FlightOfOne likes this.