[WebXR] 2D GUI selects the wrong button when panning in immersive-ar session

Hi, I am using the 2D GUI to display buttons along the bottom of the screen during an immersive-ar session. Things work as expected until I try to push a button while my device is moving, in which case the pointer events are often sent to the wrong GUI button!

It behaves as if the screen coordinates of the button press are being mapped to a real-world point and then back to a screen coordinate before being seen by the GUI. In the meantime, the real-world point has moved relative to the screen, often ‘behind’ another button.

Here’s a playground that demonstrates the problem:

Try to click on button 3 while panning left and right. You will often end up selecting buttons 1, 2, 4, or 5 depending on the speed and direction of the pan.

Any suggestions on how to fix this?

Thanks!

cc @RaananW (please be patient he is on vacations:)

Thanks Deltakosh. You all deserve vacations - Congratulations on Babylon 7!

Some more info for RaananW: I did the same test using Button3D from the 3D GUI. I could still get it to fail, but it was much harder (had to pan much faster).

fullscreen UI is always fun :slight_smile:

I tried it a few times, and I believe I eventually managed to reproduce this. Interesting catch. Issue is assigned to me, i’ll have to debug and check why it does that. I have a feeling this happens because a frame is skipped when the pointer events pass to the GUI, but i’ll be smarter after debugging this :slight_smile:

Thanks RaananW. I look forward to hearing what you discover!

1 Like