Getting out of the webxr experience

I have successfully created a webxr experience in which I watch a video texture in the vr environment.
The thing is, when I click the goggles icon, the immersive experience begins. But how do I get out of it when Im using real goggles? I click the buttons and everything else but I cannot get out of it. What do I need to add in the code to be able to exit the immersive experience?
thank you :slight_smile:

1 Like

I have noticed in a Quest 2 device, that pressing the left controller menu button will exit WebXR experiences. But in general, assuming you are using the WebXRExperienceHelper, you need to add an interaction in your experience that calls xrHelper.exitXRAsync.

Docs:

1 Like

@kaliatech thank you, Im using this:

const xr = await scene.createDefaultXRExperienceAsync({
floorMeshes: [env.ground]
});

how could I add such helper to do an exit?

The WebXRDefaultExperience makes the WebXRExperienceHelper available via baseExperience. So if you wanted to exit the scene on any pointer down event, perhaps:

scene.onPointerDown = () => {
  xr.baseExperience.exitXRAsync()
  scene.pointerDown = null
}      

Docs:

2 Likes

Hello @javismiles just checking in, was your question answered?