# Standard jump code (but for VR)

**URL:** <https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517>\
**Category:** Questions\
**Created:** [September 2, 2021, 5:11pm UTC](https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517 "2021-09-02T17:11:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [September 2, 2021, 5:11pm UTC](https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517/1 "2021-09-02T17:11:04Z")

</div>

I think that jumping in VR and not is probably the same code, but I’m wondering if anyone has “standard jump” code that I could use. A search doesn’t yield a lot on this.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 2, 2021, 5:41pm UTC](https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517/2 "2021-09-02T17:41:41Z")

</div>

Adding more content from [VR city obj =\> auto collision? sanity check - #25 by saitogroup](https://forum.babylonjs.com/t/vr-city-obj-auto-collision-sanity-check/19471/25)

“So, here’s my real question though: how do I make it so that I can teleport on top of something? Should I ask this question in another thread? I think that switching between smooth sliding and teleport is actually pretty important for “multi-level environments” (etc.). Can I do this on my own, or is this a babylonjs thing?”

Adding @RaananW

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [September 2, 2021, 5:43pm UTC](https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517/3 "2021-09-02T17:43:01Z")

</div>

these are kind of distinct questions however:

(1.) I’ve got smooth motion, I’d like to add a jump

(2.) I’ve got teleporting, I’d like to add a “teleport onto mesh” capability

but they are related to the same idea, which is navigating multi-level environments in VR

---

<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:** [September 3, 2021, 9:07am UTC](https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517/4 "2021-09-03T09:07:39Z")

</div>

the XR camera should work just like the free camera. So jumping (i assume you are not expecting the user to actually jump) can be done just like it is done in a free/universal camera.

Same thing goes to multi-level environments. There is a demo with multi-level teleportation in the doc page: [WebXR Selected Features | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/webXR/WebXRSelectedFeatures#setting-floor-meshes)

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [September 3, 2021, 3:53pm UTC](https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517/5 "2021-09-03T15:53:10Z")

</div>

Hey, thanks!

1.) OK, I’ll keep trying to find some jump code, or I’ll just try to write it (I was hoping someone would just throw some code at me, lol, but that’s the easy way out). I actually do expect the user to jump in VR. I do a lot of VR flying, so I never get sick; I know there are others out there like me, lol.

2.) Oh! Sorry, I missed the multi-level teleportation. I will look into that, that’s exactly the thing I need. Thank you!

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [September 3, 2021, 11:05pm UTC](https://forum.babylonjs.com/t/standard-jump-code-but-for-vr/23517/6 "2021-09-03T23:05:58Z")

</div>

omg it’s so insane and fun: [Login • Instagram](https://www.instagram.com/p/CTYI_j7FA1z/)

thank you!
