I’ve been following the babylon js documentation tutorial using typescript, and it’s been working like a dream. However when trying to enable XR functionality i encounter some issues.
Running this piece of code: const xr = await this._scene.createDefaultXRExperienceAsync({ floorMeshes: [this._ground], });
As suggested here works just fine, and enables VR and let’s me enter my world using a Quest 2. Good times!
However when trying anything that does not come out of babylon, but rather WebXR, following the continuation of the same tutorial here typescript no longer follows. When entering for example const sessionManager = new WebXRSessionManager(scene);
i get a
Cannot find name ‘WebXRSessionManager’
This might no be super babylon specific, but just following the tutorial when using typescript has worked great up until this point, so I figured it should now as well. I’ve tried npm install --save-dev @types/webxr
but that didn’t give me any of the types I seem to actually need.
Is it as easy as doing this with typescript is impossible? The reason I even bother asking is since babylon otherwise seems so very typescript friendly.
Cheers!