Touch input on WebXR (AR - mobile) broken?

Hey Everyone, I am trying to develop an AR application that lets you place your mesh on a surface, by tapping the screen, but I cannot get any kind of input to work while the AR mode is enabled.
Furthermore I have also tried the playground demo’s listed in the WebXR/AR documentation.(WebXR Augmented Reality Features | Babylon.js Documentation)

And the ones that require input do not seem to work.
this one for example: Babylon.js Playground

These examples are straight from the babylon documentation, Is the input system broken? Am I missing something? (I am using an up-to-date Google Pixel 4 XL).

Hello and welcome to the Babylon community!
Pinging @RaananW

i’ll check that and get back to you! thanks for reporting

Can I ask what exactly doesn’t work? can you see the white ring?

Of course!
On this url:

the passtrough works, but i do not see any white ring.

This URL does show me a white ring to be clear:

I take it the “placing a mesh” sandbox does work on your end?
I have also tried it on a Galaxy fold (i do not know exactly which model) and got the same results as i got on my pixel 4 xl.

On top of that I tried several interaction implementations on forum posts about WebAR and did not get it to work. because of that, and the playground samples not working, I concluded that the AR interactions might be broken?

it seems like google made some changes to chrome that broke this demo (mainly the plane detection is not available anymore). I’ll need to update the demo to remove the plane-detection feature from the basic demo

Oh? so it wasn’t the Interaction that broke? Could I be so bold as to ask you to point me in the direction of a working playground-setup where I can use the touchscreen during AR to have any kind of interaction with the 3d model? Like selecting the one I tap? or placing it somewhere? I have tried several things, and at this point i am just looking for a working demo to reverse engineer.

So… this should work:

Babylon.js Playground (babylonjs.com)

I am saying should because, embarrassing enough, hit-test stopped working on my test device and I have to check why. So I haven’t really tested this. However, it shows the basic concept of intercepting pointer events and using the hit-test’s current position to place an object.

1 Like

Thank you very much for taking the time to set that up for me!
however, I still get no interaction; I do get the white ring, but it does not spawn any boxes when i tap.
(at least, that is what I’ve gathered it should do from reading the code)

does it matter where i tap? I tried tapping the donut, and the scene around it.

no no, that’s on me :slight_smile:

Babylon.js Playground (babylonjs.com)

I didn’t make the box clones visible. now it should work.

oh, and one more thing - the plane detection demo (the first one you pasted) will only work if you enable the XR incubation flag in chrome://flags. But it should work as well.

1 Like

Aha! thank you very much this does work!
(Although i could’ve sworn i had that incubation flag enabled in my pixel)

edit: Just to confirm, the flag was not enabled; once i enabled it, all demos i tried did work.

3 Likes