I am trying to replace the rootMesh in controller meshes for webXR so far I was able to do it using
controller.onMotionControllerInitObservable.add((motionController) => {
motionController.setEnabled(false);
controller.onMeshLoadedObservable.add((mesh)=>{
motionController.rootMesh = BABYLON.MeshBuilder.CreateBox(`mycontrol`, {height: 0.1,width: 0.1, depth: 0.1}, scene);
motionController.rootMesh.material = new BABYLON.SimpleMaterial(`mathrash_${0}`,scene);
motionController.rootMesh.material.diffuseColor= new BABYLON.Color3(1,0,0);
});
It works on the webxr emulator but rendering the same page on a real quest 2 the black controllers appears.