WebXR Pointer up event trigger twice on one single touch

I’ve report this before but it seems happens again after update to 5.0 Pointer up Event fire twice in WebXR(ar) mode. Can reproduce in the playground here https://playground.babylonjs.com/#9K3MRA#633. I tried on an android s20 and got the pointer up event fired twice on one single tap

cc @RaananW and @PolygonalSun

Just to confirm that I understand this and how to repro it, is this double up event coming from just the initial tap when the PG is fully loaded? If so, I’m not able to repro this on my Pixel 5.

No if you are trying the playground, you need to tap once to start the WebXR session than you can see the pointer up event issue if you open the console

seems I can 100% reproduce it in that playground :smiling_face_with_tear:

any follow up on this thread @Deltakosh @PolygonalSun

I’ve taken a look at this and so far I haven’t found the root cause so I may have to talk with @RaananW when he gets back so that I can get more context on the root cause and what he did to fix it before. Best I can say is that it appears to not repro for me until something fails with the XR for me and then it repros as described. Are you seeing something like this when you try or is the camera still active for you?

1 Like

Oh yesssss you are right I copied something more than I should there so that you see the error. But that’s not related to the problem posted here. I made a better repo you might want to try out here https://playground.babylonjs.com/#9K3MRA#832. So previously you see everything fine at the beginning because you haven’t gone into the WebXR mode, the pointer up event was firing correctly if you were not in the WebXR mode. Then after the first click when you initialize the WebXR you will notice the problem happens. you can try my latest playground above I’ve clean up the code a bit so that no more errors and can see the camera view.

I’ll address this issue very soon.
@PolygonalSun - this happens because we emulate pointer up both when a controller is detached and in AR there are two of them. PR is coming later today :slight_smile:

That was quick :slight_smile:


@RaananW that fix seems do prevent it from firing two pointer events but it seems the right pointerEvent was removed? I can no longer select the mesh in the scene when I am in WebXR mode. see the playground demo here https://playground.babylonjs.com/#9K3MRA#839

@PolygonalSun @RaananW any thoughts on this?

sorry, I totally missed that. i’ll check that and will let you know! thanks

thanks! let me know how it goes

Have you had a chance to look at this one yet @RaananW ? :pray:

Doing it right now, actually

Will be merged and updated very soon