Recently ran into an issue that might be a bug. If you call xrHelp.baseExperience.exitXRAsync()
when not in WebXR mode, BABYLON gets stuck perpetually in BABYLON.WebXRState.EXITING_XR
. You cannot subsequently enter XR when you click on the XR helper button. Here’s a playground example:
https://www.babylonjs-playground.com/#I0QDTA#4
On the other hand, if you first check to make sure you are not in XR mode, you can avoid this problem. Like this:
if (xrHelp.baseExperience.state === BABYLON.WebXRState.IN_XR) {
xrHelp.baseExperience.exitXRAsync();
}
Why not have xrHelp.baseExperience.exitXRAsync()
check this internally?
Thanks.