Forum Discussion
Anonymous
10 years agoOVRPlugin.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
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
3 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionI don't think this is supported. Do you think you can find a way to use OVRManager and OVRInput as intended?
- kerskMeta Employee1) 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! - AnonymousI 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.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago