enableTeleportation floorMeshName - Multiple Mesh


I am having trouble understanding this (from the documentation):

To enable teleportation in the scene, create a mesh that the user should be able to teleport to and then enable teleportation with that mesh’s name.

var ground = BABYLON.Mesh.CreateGround("ground", 6, 6, 2, scene);
vrHelper.enableTeleportation({floorMeshName: "ground"});

What if I have more than one mesh for the ground?

I tried joining the meshes together. Since there were different materials applied, it created multiple submeshes and did not work.

Pinging @RaananW

1 Like


This is more than possible.
First, you can supply an array to the options with the direct reference to the meshes:

vrHelper.enableTeleportation({floorMeshes: [ground1, ground2, ground3]});

second, you can user addFloorMesh:

1 Like

Thanks a lot. Worked.

1 Like