Dual Laser Pointers


The BJS animated controllers on the Quest 2 look amazing!

In the Quest 2 Lobby, you see the laser pointer on both of your controllers, how can you do the same with BJS? It seems that I can only have a single laser pointer at a time.

cc @RaananW

Of course,

you can enable pointer events on both controllers using this flag:

which can be passed to the pointer selection feature using the default xr experience:

var defaultXRExperience = await scene.createDefaultXRExperienceAsync( {
pointerSelectionOptions: { enablePointerSelectionOnAllControllers: true }


Thanks! It does not seem to be in my version of BJS, will have to upgrade or maybe I am missing a dependency.

Just installed latest version 5 and it works great with it.
The only caveat was that I had to add a any for TS to compile (and VS code not to complain):

pointerSelectionOptions: { enablePointerSelectionOnAllControllers: true } as any

otherwise I was getting:

TS2739: Type '{ enablePointerSelectionOnAllControllers: true; }' is missing the following properties from type 'IWebXRControllerPointerSelectionOptions': disablePointerUpOnTouchOut, forceGazeMode, xrInput, disableScenePointerVectorUpdate

There is no need, you can set the type of options to IWebXRControllerPointerSelectionOptions , imported from the babylon package.

I wonder - typescript should detect this type automatically. pointerSelectionOptions exists in the helper’s options, and it is typed. No idea why it doesn’t detect it automatically