Forum Discussion

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

I've spent a month trying to figure this out.

Hi,

No matter what I try, I cannot detect a tap on the gear VR in unity. I've tried the following:

Input.GetMouseButtonDown(0) equals true
Input.GetMouseButtonDown(1)) equals true
Input.touchCount > 0
Input.GetButtonDown("Fire1") with the input mapping set as mouse 0 in the input settings.

OVRInput.Get(OVRInput.Button.One)

None of these work. I've attached my config input so you can see.

I find Oculus have a lack of correct documentation for developers. For example, It says to add the oculus home back button functionality, you should look at "MenuHome.cs". Well I searched for that file and couldn't find it. Then I found the file I should be looking at was "OVRPlatformMenu.cs". So in Utilities for Unity 5, it's not "MenuHome.cs", it's "OVRPlatformMenu.cs"

6 Replies

Replies have been turned off for this discussion
  • You're making the correct calls.

    If it's not working then somehow your code is not being executed - put a debug just before it (verify you see it in editor with left mouse click - then on gearvr using logcat).

    I wrote up this blog post about the gear VR touchpad:

    http://talesfromtherift.com/gearvr-input-touchpad/
  • Figured it out. It appears that a class extending "BaseInputModule", the method "Process" isn't called every game frame. And so when doing GetButtonDown, it skips the frame and doesn't register. When I changed it to GetButton, it worked.
  • Yes - button down and up events are only valid for one frame.

    You shouldn't be placing your code in a subclass of an Input Manager - it's job is to route events.

    Place your code in a separate MonoBehaviour whee you check in the Update() method.
  • kersk's avatar
    kersk
    Meta Employee
    Sorry for the hassle to get this going -- we'll work on improving the util scripts and docs for this.

    OVRInput does work for Android gamepads on GearVR, but the GearVR HMT touchpad has not been exposed through that API yet.

    You can refer to the current script for detecting touchpad taps and swipes in the Oculus Utilities @ /Assets/OVR/Moonlight/Scripts/OVRTouchpad.cs
  • "kersk" wrote:
    OVRInput does work for Android gamepads on GearVR, but the GearVR HMT touchpad has not been exposed through that API yet.


    Can you please make a note on https://developer.oculus.com/documentat ... -ovrinput/ stating this fact. I spent quite a while myself trying to figure this out.