Hi, @RaananW I know you might be the right guy to ask, I am working on an AR project which needs to use some pointer events to select meshes. I’ve set up the WebXR scene following WebXR Experience Helpers | Babylon.js Documentation with WebXRExperienceHelper (and I am using the basic one, not the default one). added the features like POINTER_SELECTION and init the xrInput class. The problem for me is the pointer up event seems triggered twice with a single tap on my phone, the pointer down seems only triggered once. I am not sure if that’s a bug, I tried both scene.onPointerUp and scene.onPointerObservable.add(async (pointerInfo) => {(different pointerInfo.type here)} returns me the same result.
Also, another one I noticed is that the event fired but seems to return all 0 inside it. Like if you try onPointerMove events, it will always trigger even it’s just a single tap and the movementX and movementY are all 0.(so there is no way for me to check if it is a drag move event or tap event) I wonder if there is something special with webXR camera because I can get the normal return event with a normal camera setting.
I wonder if there is something else I should have used for pointer selection and init the ray, I do found this WebXR Controllers Support | Babylon.js Documentation but I am not sure how to init the xrInputSource with the basic XR helper setting. I do see you said you Init the input source class which will initialize controllers in the default experience but not sure how you did that.
Sorry for the long story here, hopefully not take too much of your time to read all through this. In all, I am trying to find the best way to do some gestures recognization in webXR on mobile(like single tap, hold and drag, two-finger rotate). Let me know if all the above is the right approach, any other suggestions are highly appreciated!
sure yeah, try this https://playground.babylonjs.com/#9K3MRA#633, you need to click on scene one time to enter webXR as it requires user interaction. I just put pointer up event here to test you can see it triggered twice every click and the event detail info are all 0
I do notice something different from your screenshot, I get it triggered twice when I tap on my phone, as you see isTrusted is false and if you open the detail you will see the pointer type is ‘xr’. I do got it triggered normally once by clicking on the inspector with my mouse and the pointer type is ‘touch’
Awesome thanks for fixing that, is that also include the fix for the event detail? As I noticed in webXR mode all the event details are 0 like in scene.onPointerMoveevent.movementX and event.movementY