WebXR - How to get pickBlockerMeshes to work

I’m trying to configure meshes, that the teleportation ray cannot pass (e.g walls in a room).
I’m using the WebXRExperienceHelper and this is my code:

    if (xrHelper.baseExperience != null) {
                const featuresManager = xrHelper.baseExperience.featuresManager;
                xrHelper.teleportation = featuresManager.enableFeature(BABYLON.WebXRFeatureName.TELEPORTATION, 'stable', {
                    xrInput: xrHelper.input,
                    floorMeshes: [ground],
                    pickBlockerMeshes: collisionMeshes
                }) as BABYLON.WebXRMotionControllerTeleportation;

From my understanding the pickBlockerMeshes option should contain the meshes, that the teleportation ray cannot bypass, as described in the IWebXRTeleportationOptions documentation.
In my case its not working. I double checked the meshes, aswell as other teleportation configurations and they work, so I’m not sure if this is a bug or I am missing something.

Pinging @RaananW

Hi @D_Lav,

Checking and letting you know! Thanks for reporting

Problem found, problem solved - [XR] Fix teleportation blockers for direct lines by RaananW · Pull Request #8993 · BabylonJS/Babylon.js · GitHub

I implemented it for parabolic teleportation, but never checked that direct lines can benefit from it. My bad!
Will be available in the next nightly.

@RaananW Thanks for the quick fix.

1 Like