webXR - custom teleportation target mesh

Hello! Currently trying out a lot of different options for the webXRExperience. I wanted to make my own teleportation target mesh instead of the default blue hovering arrow over a black disc.
However, I seem to only be able to change the materials etc of the different components?
Is there a way to swap the mesh for something else?

It seems the deprecated vrExperienceHelper did have this functionality. If anyone can elaborate and answer my questions I would be more than happy to listen :smile:!

Of course, you can provide your own mesh:

Hello @Jannick, how are you?

When you construct your teleportation component using featuresManager.enableFeature you can pass a mesh to the teleportationTargetMesh field. This will replace the babylon’s wonderful doughnut by the provided mesh. If you want to support rotation, make sure your mesh has a direction indicator.

xrHelper.teleportation = featuresManager.enableFeature(WebXRFeatureName.TELEPORTATION, "stable", {
xrInput: xr.input,
floorMeshes: [ground],
defaultTargetMeshOptions: {
disableAnimation: true,
},
teleportationTargetMesh: YOUR_MESH_OBJECT
});
2 Likes

Thanks a bunch @srzerbetto & @RaananW , I got it working now! It errored out since I did not pass the other parameters, e.g. xrInput. I only passed the teleportationTargetMesh which gave me an error on “undefined controllers”.

Wish you both an amazing day!

2 Likes