# Teleport and Movement using WeXR and Quest 3

**URL:** <https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604>\
**Category:** Questions\
**Tags:** tutorial, webxr, controls\
**Created:** [January 28, 2024, 3:14pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604 "2024-01-28T15:14:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbgoldberg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jbgoldberg/32/37339_2.png) [@jbgoldberg](https://forum.babylonjs.com/u/jbgoldberg)\
**Post date:** [January 28, 2024, 3:14pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604/1 "2024-01-28T15:14:07Z")

</div>

I trying to use the WebXR to create a experience for Quest 3. I followed the documentation and a few of tutorials with no much result.  
I am able to enter the VR mode, point the controllers to the ground and the Raytrace detect the ground (turns blue with a dot the level of the ground).  
But for some reason, I cannot teleport for a new place. I am missing something, but there is nothing in the docs about what I me missing.

The VR enabling is as follows:

```auto
private async _engageVR(scene: Scene) {
    const parcel = this.landscape.getParcelByAddress(0, 0, 0);

    const xrSupport = await WebXRSessionManager.IsSessionSupportedAsync(
      "immersive-vr"
    );
    if (!xrSupport) {
      console.log("error, no XR support");
    } else {
      this.environment = scene.createDefaultEnvironment();
      // XR
      this.xrExperience = await scene.createDefaultXRExperienceAsync({
        floorMeshes: [parcel.ground],
      });

      this.xrExperience.teleportation.attach();
      this.xrExperience.pointerSelection.attach();
    }

    // Latest try - also no transportation
    // try {
    // this.xrExperience = await scene.createDefaultXRExperienceAsync({
    // floorMeshes: [parcel.ground],
    // });

    // if (!this.xrExperience.baseExperience) {
    // console.log("No XR support detected");
    // this.xrExperience.teleportation.attach();
    // this.xrExperience.pointerSelection.attach();
    // } else {
    // console.log("Engaging XR experience");
    // }
    // return true;
    // } catch (error) {
    // console.log("Error detecting XR support", error);

    // return false;
    // }
  }
}

```

Maybe is some interference from the code that generate the player, but I tried deactivate with no results:

```auto
  _createPlayer(scene: Scene, engine: Engine) {
    const camera = new ArcRotateCamera(
      "camera",
      -Math.PI / 2,
      Math.PI / 2.7,
      2000,
      new Vector3(0, 0, 0)
    );

    camera.attachControl(engine.getRenderingCanvas(), true);

    this._engageVR(scene);
  }

```

I have some questions:

1. What I am missing to make the teleporting work?
2. The initialization of the controllers made for createDefaultXRExperienceAsync() is suposed to initialize the moviment of the player also or I should deal with the during the game loop?

Thanks for the help and patience with a newbie.

---

<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:** [January 29, 2024, 2:19pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604/2 "2024-01-29T14:19:50Z")

</div>

cc @RaananW

---

<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:** [January 29, 2024, 2:28pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604/3 "2024-01-29T14:28:18Z")

</div>

Teleportation should work out of the box.

I have noticed you attach the features yourself - this is not needed. Attach is happening when the session starts. I can only assume that you are attaching too early, and some listeners are not attached.

---

<div class="post-metadata">

**Author:** ![jbgoldberg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jbgoldberg/32/37339_2.png) [@jbgoldberg](https://forum.babylonjs.com/u/jbgoldberg)\
**Post date:** [January 29, 2024, 5:35pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604/4 "2024-01-29T17:35:06Z")

</div>

I tried also without the attachment.  
I am sure it is something obvious that I am just not seeing.  
I will try a few more things next weekend and look for more info.  
Thanks for now @RaananW and @carolhmj

---

<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:** [January 29, 2024, 7:44pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604/5 "2024-01-29T19:44:25Z")

</div>

Please let me know if it still doesn’t work!

Have you tried our playgrounds? This, for example?

[WebXR basic example with teleportation | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#9K3MRA#1)

---

<div class="post-metadata">

**Author:** ![jbgoldberg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jbgoldberg/32/37339_2.png) [@jbgoldberg](https://forum.babylonjs.com/u/jbgoldberg)\
**Post date:** [February 3, 2024, 12:27pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604/6 "2024-02-03T12:27:22Z")

</div>

Sorry for taking so long to answer, but I only can work in this project at weekends.

Yes, I tried the playgrounds, but I suspect my problem is more basic and obvious. I never developed for games before and probably is something very obvious.  
Because I can turn the head in VR and the left and right turns of head works, I am sure is related to moving and not to VR itself. The system enters VR mode, control is detecting the button pressing, I can look around, but I can not move in the scene. Neither “walking” or teleporting. (I am not really sure about the right button to teleport, not none of them trigger the function. Maybe I need define something above the plane to define possible targets. Not sure.  
I will make some more tests today and let you know the result.  
Thanks for now.

---

<div class="post-metadata">

**Author:** ![jbgoldberg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jbgoldberg/32/37339_2.png) [@jbgoldberg](https://forum.babylonjs.com/u/jbgoldberg)\
**Post date:** [February 4, 2024, 2:18pm UTC](https://forum.babylonjs.com/t/teleport-and-movement-using-wexr-and-quest-3/47604/7 "2024-02-04T14:18:37Z")

</div>

Ok, I rechecked the code. The VR part is working, but the problem I am experiencing is related to the movement.  
I realize that I can not trigger the teleportation in the code you pointed out in your reply, @RaananW . It is another issue. Maybe I just don’t know how to trigger it, or maybe I need to implement the whole player and movement before it works.  
Matter of fact is I could not find any example of how to put player + movement + VR together and because I went straight to VR games, I never did it for “flat” games.  
I think I should take a step back and implement it for the non-VR experience, which goes back to this issue.  
Clearly, I am missing the foundation of my knowledge in this area.  
Thanks for now
