Babylon Inspector in Alpha Builds

Hi,

In my scene I call the debugLayer with: scene.debugLayer.show();.

I’m trying to switch over to the v5 alpha builds for Babylon. I’ve removed all trace of 4.2.0 from my package.json. I then installed v5.0.0 with the following lines:

npm i @babylonjs/core@5.0.0-alpha.30 --save
npm i @babylonjs/gui@5.0.0-alpha.30 --save

but I now get an error in my browser console:

babylon.inspector.bundle.js:1 Uncaught TypeError: Cannot read property 'GUI' of undefined
    at babylon.inspector.bundle.js:1
    at babylon.inspector.bundle.js:1

this seems to be because babylon is imported via require("babylonjs"), require("babylonjs-gui") in that inspector file, but the library now lives under @babylon instead?

Am I meant to import a specific inspector library or something like that?

Thanks in advance,

Joe

just to answer and close my own question, the inspector is now a standalone library, so additionally required to install the @babylonjs/inspector with:

https://www.npmjs.com/package/@babylonjs/inspector

Then, in your scene where the inspector is to be used, call:

import "@babylonjs/inspector";

2 Likes