Greetings everyone. I'm currently porting an app to Gear VR / Oculus Go and am trying to get scrolling working so that when the user points the controller at a 3D GameObject, they can scroll on the touchpad and IScrollHandler events will be sent to the script on that object that implements IScrollHandler.
When I first found that this wasn't working, I assumed that I had misconfigured something, because I could see that there was code in OVRInputModule that executed IScrollHandler events, and there are public options on that script related to scrolling. Digging in deeper, however, I have come to the conclusion that scrolling is not supported for Gear VR / Oculus Go, and that IScrollHandler events are only implemented for an actual mouse and for a gamepad controller. Can anyone please confirm that this conclusion is correct? Here's what I found in OVRInputModule that led me to that conclusion:
- IScrollHandler events are only executed when leftButtonData.buttonData.scrollDelta.sqrMagnitude is non-zero
- There are two places where scrollDelta is set:
- In GetGazePointerData(), it's set to GetExtraScrollDelta(), which is determined by the gamepad
- In GetCanvasPointerData(), it's set to Input.mouseScrollDelta
- I observed that Input.mouseScrollDelta is always (0, 0), even while I'm scrolling on the touchpad
- I suspected that there would be code in the Oculus Unity Utilities package to map the controller touchpad's scroll to mouseScrollData, but I didn't find anything that appeared to do that
- If I replace the call to `leftData.scrollDelta = Input.mouseScrollDelta;` in OVRInputModule with a fixed value like `leftData.scrollDelta = new Vector2(1, 1);`, the scroll events are sent to my GameObject like I expect and trigger scrolling. So it's not an issue with how my script is listening for scroll events.
So, can anyone please confirm that scrolling isn't supported out-of-the-box for Gear VR / Oculus? My current plan is to roll my own scrolling or port the GvrPointerScrollInput script from the GoogleVR SDK to work with the Oculus mobile controller, but since those options will take me some time, I thought I'd ask here before diving in.