WebXR controller models not loading in Next.js

Hello!

So I’ve been trying to get babylon.js WebXR integrated nicely with Next.js (not using react-babylonjs) and followed the steps in the documentation for integrating with React.

I also am using next-transpile-modules.

I got it almost working perfectly, but the WebXR controller models don’t load and it defaults to the fallback controller meshes.

In the console I’m getting this error - glTF / glb loader was not registered, using generic controller instead

If you could help me out with this I’ll love you forever.

repo - GitHub - KennyStanley/babylon-webxr-nextjs
website - https://babylon-webxr-nextjs.netlify.app/

Whoops!
Just figured it out. All I had to do was add - import '@babylonjs/loaders/glTF'
I’m sorry, still super new to Babylon.js!

2 Likes