WebXRDefaultExperience Icon error shows Error when clicked

Using the WebXRDefaultExperience. the VR button shows up in the lower right of my screen because I have the WebXR API Emulator installed in my browser, Edge and Chrome on Windows 11.
When I click on the Button, the word Error is display over the button and the experience does not go into XR.
image
what could be causing this and how to debug?
Thanks,
Michael

1 Like

Summoning @RaananW the WebXR djinn :slight_smile:

2 Likes

there is nothing coming out of the console output that would provide a hint.
except this: when the scene initializes.
WebXR emulator extension overrides native WebXR API with polyfill.

Do you have the emulator open in the console? Can you make sure you have selected a device that fits the current requested session (vr or ar) and that it is running correctly?

Can I also ask - what scene are you trying to run? Any custom features that you are trying to initialize?

Also - hovering over the button should show you the error (it should be in the title of the image).

I am using BABYLON.GUI heavily but turn it off when going into VR -
I have tried all of the devices in the WebXR emulator.

the error message is: Error entering XR session - immersive-vr - local-floor

I think I figured it out - an uncaught exception in my code entering the VR state.

1 Like

Was it the exception, then? :smiley:

This is the promise failing. I’ll see what we can do in logging the rejection more clearly. It should be at least logging it in the console. Can you share the code that failed so I will see what went wrong?

1 Like

I hate to necromance an old thread, but was this ever figured out or was any more verbose debugging ever included to help? I am getting the same error goggles of death but my console is showing a clean launch.

Adding @RaananW but bear with him as he is in vacation for a bit :slight_smile:

Oh no. This was supposed to be fixed. The error should be logged, unless it is an error that happens before the XR session even starts (which is out of our control). Would you be able to reproduce that?

BTW - On desktop you can hover over the button and see the error (if it is an XR error). I understand it might be an issue on mobile though…

Sorry, following up on this today -

If you define the onError parameter of the ui options in the default XR experience you will get the error and will be able to log it. This is needed when the error is not a part of the actual initialization of the session (the babylon code). Here is an example:

WebXR basic example with teleportation | Babylon.js Playground (babylonjs.com)