cancel
Showing results for 
Search instead for 
Did you mean: 

Meta XR Interaction SDK bug: Ray on UI Scroll View

ReturnLegend
Honored Guest

I created a UI. When I scrolled the scrollview with a ray, once the ray went beyond the range of the UI panel, the scrollview would immediately bounce back to a wrong position. Then I tried to look at the official Demo. In the ComprehensiveRigExample.unity Demo, the Scrollview still had this problem.

1 ACCEPTED SOLUTION

Accepted Solutions

hvox1138
Protege

Looks like the behavior in the ComprehensiveRigExample scene was caused by not having the `SelectSurface` on CanvasInteractables object's `RayInteractor` set. That surface is what allows the ray to continue hitting something even when it goes off the edge of the panel, so having it not set disrupts the ability to keep scrolling beyond the edge of the panel. Our fix will come in a future release, but you can fix this locally by just dragging the CanvasPanel object into "CanvasInteractables > RayInteractable > Optionals > SelectSurface." You should likely be able to do something similar for your own UI as well. Hope this helps, and best of luck!

View solution in original post

5 REPLIES 5

hvox1138
Protege

Hi ReturnLegend, thanks for bringing this to our attention! We've confirmed we're able to reproduce the same behavior, we're investigating the cause, and we hope to get back to you with more information soon. Thanks for your patience!

hvox1138
Protege

Looks like the behavior in the ComprehensiveRigExample scene was caused by not having the `SelectSurface` on CanvasInteractables object's `RayInteractor` set. That surface is what allows the ray to continue hitting something even when it goes off the edge of the panel, so having it not set disrupts the ability to keep scrolling beyond the edge of the panel. Our fix will come in a future release, but you can fix this locally by just dragging the CanvasPanel object into "CanvasInteractables > RayInteractable > Optionals > SelectSurface." You should likely be able to do something similar for your own UI as well. Hope this helps, and best of luck!

Thanks for you reply, this problem is solved! 

But I still have a little question.  I drag the CanvasPanel object into "CanvasInteractables > RayInteractable > Optionals > SelectSurface."  Since the "Plane Suface" on  "CanvasPanel" is not infinite, when you drag the scrollview if the ray outside this CanvasPanel boundary (although the boundary is very large), the above problem will still occur. Is this in line with expectations?

Glad it worked for you! I believe the `PlaneSurface` conceptually is infinite (though of course in practice that's subject to floating point math and other such constraints), so you shouldn't be able to raycast off the edge of it per se. However, if you point your controller backwards (away from the panel so that the ray no longer intersects the plane at all), you will likely see the same behavior you saw before, which will look like you traced off the edge of the plane. What's actually happening is is that, when the raycast does not hit the select surface, the `PointerEvent`s generated by the interactor no longer have a real position and default to (0, 0, 0). The canvas interprets this as your interaction point suddenly dropping to the floor (or wherever the world origin is), which is why the scroll view appears to be instantly pulled very far down. We're looking into the best way to address this, but it'll likely require a bigger behavior change than just setting the select surface. Hope this was helpful!

Got it! Thank you very much for your detailed answer