Skip to main content
January 25, 2016

OVRPlugin.GetInputState not returning data for GamePads

We are currenty using OVRPlugin.GetInputState to query the state of the Touch devices and have started to add support for the XBox One controller. We have noticed that the OVRPlugin.GetInputState method does not seem to work as expected when it has been passed the Gamepad enumeration value.

1.) The InputState structure is always zeroed out and does not represent the current state of the controller. The ConnectedControllers field will always be 0 even though the controller is connected.
2.) Unity will hard crash if the headset happens to be powered down and this code is executed.

Example:
OVRPlugin.InputState state = OVRPlugin.GetInputState((uint)OVRInput.Controller.Gamepad);


Should OVRPlugin.GetInputState return the state of Game Pads? Or is this functionality only supported via the OVRInput class? We currently do not use OVRManager. Therefore, we cannot take advantage of the OVRInput object since it relies on OVRManager.

-Bill
    This topic has been closed for replies.

    3 replies

    Inspiring
    January 25, 2016
    I don't think this is supported. Do you think you can find a way to use OVRManager and OVRInput as intended?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Meta Employee
    January 25, 2016
    1) You're correct - Xbox/Gamepad input is currently only supported via OVRInput.cs. This is because we are using our legacy OVRGamepad.dll under the hood to provide Xbox/Gamepad support. OVRPlugin does not support those input sources directly yet, but that is planned for a future release. That would also allow us to remove OVRGamepad.dll at that point. For now, you can take a look at the OVRControllerGamepadDesktop class in OVRInput.cs for an example of how to use OVRGamepad.dll if using OVRManager/OVRInput is not an option.

    2) If you guard OVRPlugin.GetInputState() with a check on "if (OVRPlugin.hmdPresent)", that should prevent the crash.

    Can you go into more detail on why you're not using OVRManager? That would be useful feedback. Thanks!
    January 26, 2016
    I have only recently joined the project and don't have a full understanding as to what problems we have run into with OVRManager. From what I understand, there was a concern with how the OVRManager forced the VR Rig to be posed and it did not mesh well with our game.