[SOLVED] Can't get Valve Index controller buttons working with OpenXR and Input System

My game is currently released on Steam and supports SteamVR but its using an old 2018 version of Unity.

The old SteamVR plugin doesn’t seem to be working with newer versions of unity (2022.3.16f1) so it seems like I should switch my project over to OpenXR and the Input System? Is that a good choice?

Here are the steps I followed:

-opened new project in Unity 2022.3.16f1

-Imported OpenXR from package manager

-Imported Input System from package manager

-Imported XR Interaction Toolkit with starter assets from package manager

-Enabled OpenXR in project settings

-Add Valve Index Controller Profile to Enabled Interaction Profiles

-Added XR Rig to scene

-Linked left and right hand Reference to hands

-Position tracking is now working for head and hands

-Create C# script that gets a InputActionReference and debug.logs its value. I tested it by adding an alternative button binding to a button on the keyboard and I get 1 or 0 from the keyboard input. But no matter what I try, I cannot get anything but 0 from the Valve Index Controller buttons, triggers, joysticks, ect.

Am I missing a key step?

Any help would be very appreciated! Thanks!

I figured out the problem! I needed to touch the proximity sensor inside the headset! I wasn’t putting on the headset because I wanted to see the debug.log message to see if the button was returning a value!

I wish there was a way to disable this. I often test my game without putting the headset on…

Here’s the thread that finally helped me solve the issue.

Also, this might have helped too, I upgraded to Unity 2023. That fixed the XR simulator being able to give me a value from the button and also fixed a weird UI glitch in the input system setup menu.

1 Like