Input for Steam VR and Unity XR Interaction Toolkit

Is there any way to make the inputs in Steam VR work with the Unity XR Interaction Toolkit?

We don’t support the SteamVR plugin. XRI supports using Input System actions for inputs and we suggest users use that for input binding.

If you are only developing for SteamVR, it is much better to stick with the SteamVR plugin as you get much more control without worrying about the following.

You are asking SteamVR to work with the XR Interaction Toolkit, thus, you should be developing in XR for SteamVR and other platforms (Andriod, MockHMD, etc…). By asking this, you want to develop for multiple platforms at once without building separate scripts for input management. This is a problem I’m very familiar with. This link does a great job explaining some of the problems and fixing unity XR interaction to work with steamer and oculus in 2020+:
How to make SteamVR input work with Unity XR Interaction Toolkit in Unity - The Ghost Howls.
My suggestion is to start these steps from scratch in a new project and import all your game assets into the new project. If this is not possible, it still might be worth it to go through the steps once in a fresh project just to make sure you can get everything working (Make sure you test out both types of builds, and not just the unity editor!)

Here is a little shortcut from the article if interested: “UPDATE 2020.10.04: Beep2BleepGames has created a GitHub repo with an out-of-the-box ready Unity 2020 solution already implementing this hack! You can check it out at this GitHub repo: GitHub - beep2bleep/SteamVRWorkingWithUnityXTToolkit: SteamVRWorkingWithUnityXTToolkit basic empty project for Unity 2020.1” - Note that it is very hard to use this in an existing project without going through the steps listed anyways.

Of note:

  • Oculus works with these steps very well (no references to SteamVR and inputs map just as expected, no extra steps).
  • These steps don’t have an extensive set of Steamvr input actions built out, instead, it’s only set up for the default generated inputs. If you want to add input mappings in Steamvr (say primary button pressed), you must also add them within the “InputDeviceWrapper” class (see step 9).
  • The InputDeviceWrapper class is the new class you should be using to get input from controllers. This might mean that the current way your scripts are written might need a little tweaking.

I have a Github project on my page addressing some of these problems (essentially taking the Beep2BleepGames project further for easy usage) but it is very much still in the development state. If you want to use this, all inputs are mapped within the InputDeviceWrapper class but there are no SteamVR input files generated for the controllers other than the quest (mapping can be done in unity or in SteamVR itself if desired).

Let me know if you need any help or if you are looking for other workarounds. Cheers!