@RaananW Hi, is it possible that the issue has come back ? I am facing it in my AR project, and I managed to repoduce it here : Test double pointer up XR | Babylon.js Playground (babylonjs.com)
When in the AR session, every tap results in 1 down event and 2 up events. This happens whether with scene.onPointerDown/scene.onPointerUp callbacks or with scene.onPointerObservable.add(…).
There is a difference with @xtxz’s repro, I don’t do all the “complex” xr initialization. I’m only relying on scene.createDefaultXRExperienceAsync(), but I am not sure this has something to do with the issue.
will look into that! Should, of course, not have happened, but everything is possible.
This is happening because near interaction is now enabled per default, and it was triggering a pointer up when a controller was detached. This PR will fix it:
[XR] Only trigger near pointer up if down was triggered by RaananW · Pull Request #14860 · BabylonJS/Babylon.js (github.com)
A side note - checking the type of the pointer up will make it safer when processing pointer events. the default type in XR is “xr”, whereas near interaction events have the type xr-near , so you can differentiate between the two.
1 Like
Thank you for the side note ![:pray: :pray:](https://emoji.discourse-cdn.com/win10/pray.png?v=12)
Thank you, as well, for taking care of this issue. Could you quickly explain what ‘near interaction’ means? Although I’m guessing it has something to do with direct interaction between controllers and 3D objects/GUI, I wasn’t able to find a complete explanation.
Exactly that ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/win10/slight_smile.png?v=12)
The difference between ray picking and “touching”. objects. makes a little less sense when in mobile AR, as it is only being helpful when using controllers/hands in immersive mode.
1 Like