Forum Discussion
ReturnLegend
2 years agoHonored Guest
Meta XR Interaction SDK bug: Ray on UI Scroll View
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.
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!
5 Replies
Replies have been turned off for this discussion
- hvox1138Protege
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!
- hvox1138Protege
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!
- ReturnLegendHonored Guest
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?
- hvox1138Protege
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!
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
- 2 years ago