# React-babylon teleportation

**URL:** <https://forum.babylonjs.com/t/react-babylon-teleportation/14510>\
**Category:** Questions\
**Tags:** react\
**Created:** [September 29, 2020, 4:21am UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510 "2020-09-29T04:21:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![arooly](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arooly](https://forum.babylonjs.com/u/arooly)\
**Post date:** [September 29, 2020, 4:21am UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/1 "2020-09-29T04:21:31Z")

</div>

Hi,

How do I implement the teleportation and controller functionality in VR with react-babylon.

```
           <Engine
              antialias={true}
              adaptToDeviceRatio={true}
              canvasId="my-canvas"
            >
              <Scene id="my-scene">
                <arcRotateCamera
                  name="arc"
                  target={new Vector3(0, 1, 0)}
                  alpha={-Math.PI / 2}
                  beta={0.5 + Math.PI / 4}
                  radius={2}
                  minZ={0.001}
                  wheelPrecision={50}
                />

                <directionalLight
                  name="dl"
                  direction={new Vector3(0, -0.5, 0.5)}
                  position={new Vector3(0, 2, 0.5)}
                />

                <icoSphere
                  name="counterClockwise"
                  position={new Vector3(-0.5, 1, 0)}
                  radius={0.2}
                  flat={true}
                  subdivisions={1}
                >
                  <standardMaterial
                    diffuseColor={Color3.Yellow()}
                    specularColor={Color3.Black()}
                  />
                </icoSphere>

                <icoSphere
                  name="clockwise"
                  position={new Vector3(0.5, 1, 0)}
                  radius={0.2}
                  flat={true}
                  subdivisions={1}
                >
                  <standardMaterial
                    diffuseColor={Color3.FromInts(255, 165, 0)}
                    specularColor={Color3.Black()}
                  />
                </icoSphere>

                <ground
                  name="ground"
                  width={50}
                  height={50}
                  subdivisions={8}
                >
                  <standardMaterial
                    diffuseColor={Color3.FromInts(255, 165, 0)}
                    specularColor={Color3.Black()}
                  />
                </ground>

                <vrExperienceHelper
                  webVROptions={{ createDeviceOrientationCamera: false }}
                  teleportEnvironmentGround={true}
                  enableTeleportation={{ floorMeshName: "ground" }}
                  enableInteractions={true}
                />
              </Scene>
            </Engine>
```

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 29, 2020, 8:31am UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/2 "2020-09-29T08:31:22Z")

</div>

Pinging @brianzinn who is the master of react-babylon.

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [September 29, 2020, 4:38pm UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/3 "2020-09-29T16:38:51Z")

</div>

Good question! What you have there ought to work as-is. Unfortunately `enableTeleportation` is not being picked up. I will need to update the code generation - some methods aren’t handled by the renderer - currently it’s done explicitly by a pattern. I’ll put out a new version tonight after work 🙂

---

<div class="post-metadata">

**Author:** ![arooly](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arooly](https://forum.babylonjs.com/u/arooly)\
**Post date:** [September 29, 2020, 5:20pm UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/4 "2020-09-29T17:20:04Z")

</div>

Wow, thank you so much. I was sure it was my limited experience. I love your react-babylon.  
I intend to use it quite extensively so unfortunately I will continue to bother you.

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [September 30, 2020, 6:20am UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/5 "2020-09-30T06:20:18Z")

</div>

please try the latest NPM 2.2.9 - i added enableTeleportation support, but did not have time to test it out… let me know how it goes 🙂

---

<div class="post-metadata">

**Author:** ![arooly](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arooly](https://forum.babylonjs.com/u/arooly)\
**Post date:** [September 30, 2020, 5:48pm UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/6 "2020-09-30T17:48:31Z")

</div>

Hi Brian,

I tested NPM 2.2.9 the controller ray is visible, I can use the controller to rotate around. Teleportation, front and back seems not to work. I will play more with the code and let you know.  
Thank’s for the effort.

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [September 30, 2020, 11:30pm UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/7 "2020-09-30T23:30:58Z")

</div>

I recall the back and front small movement being done on the thumb controller, but will depend on your device. Does this mean teleportation is working otherwise on the ground? Keep bothering us - that’s how we make it easier for the next person 🙂

---

<div class="post-metadata">

**Author:** ![arooly](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arooly](https://forum.babylonjs.com/u/arooly)\
**Post date:** [October 1, 2020, 12:00am UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/8 "2020-10-01T00:00:08Z")

</div>

No the teleportation is not working only 360 rotate. I am trying to record the VR session and send it to you. It looks like I can only save videos only to my Facebook account (I have Oculus Rift) and I am not used with Facebook, in fact it will be my first post Facebook ever. I will try to record and send you the video link hope this works, it may take me some time.

---

<div class="post-metadata">

**Author:** ![arooly](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arooly](https://forum.babylonjs.com/u/arooly)\
**Post date:** [October 1, 2020, 1:44am UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/9 "2020-10-01T01:44:22Z")

</div>

OK, I was not successful recording the VR session. Oculus is aborting when I enter VR from the browser. I tried Nvidia capture screen but in the browser you can’t see the VR experience.  
I have an Oculus Rift and the movement is done with the thumb controller. Left right is rotate in increments 30 degree maybe, front & back short is front and back step increments. Controller Ray touching the ground is teleportation to the location of the Ground, Ray intersection.

What is working: Ray is on, left and right will rotate camera left and right by 30 degree maybe.

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [October 1, 2020, 3:33am UTC](https://forum.babylonjs.com/t/react-babylon-teleportation/14510/10 "2020-10-01T03:33:18Z")

</div>

let me dig out my vr headset and give it a try!
