webXR pointer length not changing

I’ve been migrating my program to webXR using babylon 4.2.0 and I am trying to arrange for the laser pointer on my oculus quest to extend a very long way. I’ve tried reinitialising the pointer with

xrHelper = await scene.createDefaultXRExperienceAsync({});
xrHelper.pointerSelection.dispose();
xrHelper.pointerSelection <BABYLON.WebXRControllerPointerSelection>xrHelper.baseExperience.featuresManager.enableFeature(BABYLON.WebXRFeatureName.POINTER_SELECTION, "latest", {
xrInput: xrHelper.input,
disableSwitchOnClick: false,
maxPointerDistance: 100000,
});
xrHelper.pointerSelection.laserPointerDefaultColor = new BABYLON.Color3(0.5, 0.1, 0.1);
xrHelper.pointerSelection.displayLaserPointer = true;
xrHelper.pointerSelection.displaySelectionMesh = true;

The pointer colour duly changes, but the length doesn’t. What am I doing wrong?

@RaananW our own XR expert might be able to help :slight_smile:

The length of the pointer is calculated automatically based on the object you are pointing at.
What is the final result you are expecting?

As a side note - I would recommend you using the latest preview, as it contains a lot of XR fixes and new features.

I’m building a planetarium program which displays points on a sphere a very long way away and I want the pointer to extend all the way to that grid. With the old WebVR I just set the pointer length to a very large number and it appeared to go off into the distance. The key thing is that the pointer extends as far as the light representing the closest star, so I can then display information about it.
Any suggestions?

The max length is the max length in which the pointer will detect objects.

Maybe if you can create a simple playground to explain the situation I will be able to understand better. In XR, 1 unit is 1 meter. Objects very far away (i.e. 100000 units away) should be huge in order to be able to see them. But then you will need to adjust not only the length of the pointer but also the diameter and the size of the selection disk, otherwise you won’t see them at all (i.e. - they need to be huge as well :slight_smile:

OK Thanks for that. Based on your info, I’ve solved my problem by creating a transparent sphere a long way away as a pickable target. My starfield doesn’t work as a target because it’s a mesh for a custom shader rather than a proper sphere. This wasn’t a problem with VR because the laser pointer length worked differently. Might be worth documenting that difference in the XR docs.