# Getting out of the webxr experience

**URL:** <https://forum.babylonjs.com/t/getting-out-of-the-webxr-experience/28371>\
**Category:** Questions\
**Created:** [March 12, 2022, 6:26am UTC](https://forum.babylonjs.com/t/getting-out-of-the-webxr-experience/28371 "2022-03-12T06:26:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [March 12, 2022, 6:26am UTC](https://forum.babylonjs.com/t/getting-out-of-the-webxr-experience/28371/1 "2022-03-12T06:26:08Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![kaliatech](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kaliatech/32/13557_2.png) [@kaliatech](https://forum.babylonjs.com/u/kaliatech)\
**Post date:** [March 12, 2022, 1:26pm UTC](https://forum.babylonjs.com/t/getting-out-of-the-webxr-experience/28371/2 "2022-03-12T13:26:30Z")

</div>

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:

- [WebXR Experience Helpers | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/webXR/webXRExperienceHelpers#exiting-xr)

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [March 12, 2022, 2:57pm UTC](https://forum.babylonjs.com/t/getting-out-of-the-webxr-experience/28371/3 "2022-03-12T14:57:13Z")

</div>

@kaliatech thank you, Im using this:

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

how could I add such helper to do an exit?

---

<div class="post-metadata">

**Author:** ![kaliatech](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kaliatech/32/13557_2.png) [@kaliatech](https://forum.babylonjs.com/u/kaliatech)\
**Post date:** [March 12, 2022, 3:19pm UTC](https://forum.babylonjs.com/t/getting-out-of-the-webxr-experience/28371/4 "2022-03-12T15:19:11Z")

</div>

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

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

```

Docs:

- [WebXR Experience Helpers | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/webXR/webXRExperienceHelpers#basic-usage-of-default-experience)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 11, 2022, 11:22am UTC](https://forum.babylonjs.com/t/getting-out-of-the-webxr-experience/28371/5 "2022-04-11T11:22:22Z")

</div>

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