So for school I am making a webshop that allows users to view the product in AR. With WebXR I have added an overlay to the AR session that contains a button to reposition the model. I found out that when I press the button, the click event on the button is triggered but also the select event on the ARController is also triggered.
Is there a way to prevent the controller from triggering when I click the button?
Thanks :)
You need to use the beforexrselect event and call preventDefault() as explained here : https://www.w3.org/TR/webxr-dom-overlays-1/#onbeforexrselect
buttonOnOverlay.addEventListener('beforexrselect', e => {
e.preventDefault();
});