# WebXR teleport to lower floors changes teleport behavior drastically

**URL:** <https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111>\
**Category:** Bugs\
**Tags:** webxr\
**Created:** [August 8, 2023, 7:26pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111 "2023-08-08T19:26:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NightSkies](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@NightSkies](https://forum.babylonjs.com/u/NightSkies)\
**Post date:** [August 8, 2023, 7:26pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/1 "2023-08-08T19:26:58Z")

</div>

Hi,

WebXR immersive mode - Teleporting to a lower floor causes the teleport behavior to work less effectively. The minimum teleport distance while pointing at the ground seems to grow proportionately to how far down that floor is.

Users also have trouble teleporting up ramps once they get down to a lower level.

The only way to make this work predictably is to point the controller very high into the air (almost vertical). Lowering the parabolicCheckDistance lessens the issue when going to a lower floor but you cannot teleport as far.

This has been brought up before but this happens also in this trivial example. [https://playground.babylonjs.com/#CVVLJ9#16](https://playground.babylonjs.com/#CVVLJ9#16).

> [@WebXR teleportation works weirdly](https://forum.babylonjs.com/t/webxr-teleportation-works-weirdly/16013/7):
>
> Hey! Sorry for not getting back to this post. Yes, I did check this scene - and it does behave weird, but this is expected from the way it is being used slight_smile A groupd should be, well, a ground. You are using a complex model (the house) as a ground. If you expect to be able to teleport inside the house by just providing the house as a ground mesh - it won’t work as expected. You will either need to generate a new mesh for that, or separate the house to ground and walls. The 2nd floor…

Thanks,

Night

resolved earlier half of the post, thanks for the help @Cedric

Kinda 2 things here. VR teleport bug, and I need a hand getting the demonstration playground example to work to begin with. The bug is reproduced in our codebase, but just having a struggle getting navmeshes working in babylon playground here.

A) [https://playground.babylonjs.com/#CVVLJ9#11](https://playground.babylonjs.com/#CVVLJ9#11)

The navmesh in this playground doesn’t work.  
I would set it up like the other examples but don’t you have to have separate wall meshes and such? I don’t have the assets handy for that right now.

Our code uses Recast plugin, but imports it and passes the module in. Usual examples dont pass anything in. We use buildFromNavmeshData.

```auto
            const navigationPlugin = new BABYLON.RecastJSPlugin(recast);
            ...
            const navMeshURL = "https://cdn.glitch.global/38b631a0-9744-4531-a771-2d87d5e99fc3/frame-aud3-navmesh.bin?v=1691102803753";
            ...fetched...

            navigationPlugin.buildFromNavmeshData(
                new Uint8Array(navmeshBinary)
            );
            let navmeshdebug = navigationPlugin.createDebugNavMesh(scene);

```

Can anyone help fix this? It demonstrates the bug below.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [August 9, 2023, 10:37am UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/2 "2023-08-09T10:37:31Z")

</div>

CC @Cedric regarding recast  
I will look into the teleportation issue

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [August 9, 2023, 1:20pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/3 "2023-08-09T13:20:09Z")

</div>

Hi @NightSkies  
Here is a quick PG that loads your navmesh binary data:

> **[Babylon.js Playground](https://playground.babylonjs.com/#BWUHUA)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

It’s using Babylon.js Tools to load the file because I’m more used to this API.

---

<div class="post-metadata">

**Author:** ![NightSkies](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@NightSkies](https://forum.babylonjs.com/u/NightSkies)\
**Post date:** [August 9, 2023, 9:23pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/4 "2023-08-09T21:23:03Z")

</div>

Thanks! I was able to get my WebXR bug example totally working/and buggy as intended.

A is done.

B ?  
The example above demonstrates very wierd behavior with the teleport once you start going down levels. I have to either point through the floor at a steep down angle or an extreme high angle (instead of just aiming for a spot on the floor).  
Even the starting area of the mesh does odd things too.

---

<div class="post-metadata">

**Author:** ![NightSkies](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@NightSkies](https://forum.babylonjs.com/u/NightSkies)\
**Post date:** [August 9, 2023, 9:25pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/5 "2023-08-09T21:25:52Z")

</div>

Playground sample has been updated, and demonstrates the bug!

> **[Babylon.js Playground](https://playground.babylonjs.com/#CVVLJ9%2316)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Thanks!  
Night

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [August 10, 2023, 6:56pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/6 "2023-08-10T18:56:38Z")

</div>

sorry, assigning this to me, i’ll see what can be done here

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [August 10, 2023, 6:56pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/7 "2023-08-10T18:56:42Z")

</div>

Assigned @RaananW on August 10, 2023, 6:56pm UTC



---

<div class="post-metadata">

**Author:** ![NightSkies](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@NightSkies](https://forum.babylonjs.com/u/NightSkies)\
**Post date:** [August 10, 2023, 8:00pm UTC](https://forum.babylonjs.com/t/webxr-teleport-to-lower-floors-changes-teleport-behavior-drastically/43111/8 "2023-08-10T20:00:59Z")

</div>

Thanks for looking at it.  
In our actual application, the starting area does appear to behave more normally than the babylon playground example. But certainly, the problem gets worse the further you go down, and it is also directly proportionate to the parabolicCheckDistance.  
Ty!
