Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
amarillosebas's avatar
10 years ago

Under what circumstances does OVRInput does work?

I'm updating an old DK2 project in Unity to the newest version of the rift. I'm having a very tough time with the input system.

I've read the input documentation and I've come to a very good understanding of how it works. I'm an experienced game programmer/dev. So far, if I use the default OVRPlayerController the input will work just fine, but if I try to use OVRInput.Get(), whatever I try will always return false. The only exception is when I created an empty scene and wrote a simple script with only this line and attached it to a plane:
Debug.Log(OVRInput.Get(OVRInput.Button.One));

That's the only time I've gotten the input system to actually return true when I pressed a button. I have not done anything fancy with the input system in my project. I've barely used it.

So, I'm wondering, maybe there's some kind of setup that I need to do before trying to use the input system? Or maybe it won't work properly if some type of object/component/code is on the scene. What am I missing here?

4 Replies

Replies have been turned off for this discussion
  • I forgot to mention, I even tried deactivating every object in the scene that I'm having problems with except the empty GameObject containing that line of code, and it still won't return anything other than false everytime.

    Also, I can press the home button and it will take me to the options screen (I don't know what it's called), so the controller is properly recognized.
  • You will need an OVRManager instance in your scene to initialize and manage the Oculus SDK's script bindings.
  • OVRInput will work without OVRManager in your scene as well, but you will need to call OVRInput.Update() in your class' Update function.