WebXR Babylon WebXRHitTest is missing


I am trying to enable the HitTest feature with the WebXR feature manager. I am working from the current NPM build which has the option to use WebXRHitTestLegacy and it doesn’t work. Looking at the current GitHub dev build there is two option for HitTest. WebXRHitTest is the documented way to successfully make this work.

I understand that WebXR is a moving target. What is the current way to make HitTest work?

Thank you

Pinging @RaananW

Hi Eddie,

The WebXR Legacy hit test is the hit test support for older versions of the webxr API. the newer, WebXRHitTest should work correctly. To enable hit test you will need to enable the hit0test optional feature when starting your webxr session. You can do that be explicitly providing the string when creating the session, or by setting the optionalFeatures parameter to true (Babylon.js/webXRDefaultExperience.ts at master · BabylonJS/Babylon.js · GitHub) which will enable all experimental features (plane, anchors, hit-test).

Also, of course, hit-test currently works only in ar-enabled smart phones. There is however an experimental support in the webxr emulator if you want to test on the desktop.