[XR] WebXRPlaneDetector not finding planes


I am trying to create an AR demo with plane detection, but my current build does not find any planes using BABYLON.WebXRPlaneDetector. I’ve tried following the WebXR documentation closely but I am finding no luck. Can anyone see where I might be going wrong?

I’m using a Google Pixel 4 and no errors are showing but I believe the console.log I added should be called but it isn’t.

I’ve added the code to the linked playground below.


First, it is always possible that your device doesn’t find planes in your scene. Try using it on a highly-textured straight surface (like a wooden floor or a curtain).

Second - be sure to use the latest chrome and enable the webxr incubation flag in chrome://flags (just in case. It should actually work out of the box, but some features are only working with the flag turned on).

I updated your playground as it was not working correctly - https://www.babylonjs-playground.com/#KAMZ6H#2

This updated version results (on my device) in this:


1 Like

Hi RaananW, thanks so much for taking the time to help me out!

As you suggested, enabling the WebXR Incubation flag in chrome://flags on my mobile device fixed the issue.

1 Like

Hi @RaananW!

I am having same problems (also with hit tests). Switching webxr incubation flag from ‘default’ to ‘enabled’ does solve the problem - however it is not very user friendly. Is it something that can potentially work out of the box in the foreseeable future ? (might be smth on google’s side though)

When I am trying immersive web examples (Hit Test)
they are actually working well without flag switching - should not they be using the same ARCore API? or am I missing something here?

Hit-Test alone (without plane detection and anchors) will work out of the box. This example:


Will only use hit-test and can therefore be used even without the incubation flag

Ok, it does work! Thanks for clarifying that!
Maybe this alone would be sufficient for my needs. I just need to place objects on the floor. (ideally i would have them aligned orthogonally to rooms walls, but maybe i can live without that for now)

Hit test will provide the right transformation :slight_smile: The only reason I used plane detection is so that i can add shadows to the objects I add.


Great! Thanks again :slight_smile: