How to start the inspector

Hello everyone

I try to start the inspector on my local project but I got an error “Cannot read property ‘Inspector’ of undefined.”
I currently run the 4.0.0-alpha.18 version.
I try to follow the instruction from the How To and use the line

BABYLON.DebugLayer.InspectorURL = 'http://myurl/babylon.inspector.bundle.js';

But when i check, it seems that BABYLON.DebugLayer is undefined. I don’t really understand what I am doing wrong. Can someone help me ?

Just to be sure, when you say that you use this line:

BABYLON.DebugLayer.InspectorURL = "http://myurl/babylon.inspector.bundle.js";

have you actually change the value to your local inspector file?

1 Like

Did you add a reference to the inspector (are you using npm or vanilla script ref?)

Thanks guys. I don’t know if i did exactly the right thing but it works. Here is what I did :

  • npm install --save babylonjs babylonjs-inspector

  • import ‘babylonjs-inspector’;
    in my scene file

  • new Inspector(this.scene, true)
    to launch the debugLayer

1 Like