How to use inspector with viewer?

Hi All

I tried importing the inspector to use with a viewer

<script src="https://cdn.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
<script src="https://cdn.babylonjs.com/viewer/babylon.viewer.js"></script>

then using :

BabylonViewer.viewerManager
        .getViewerPromiseById("bjshh7bu29f")
        .then(function (viewer) {         
          viewer.onSceneInitObservable.add(function (scene) {             
            scene.debugLayer.show();           
            return scene;
          });
         
        });

i get errors …

so how to do this…?

I think you need to add the babylon.js script: <script src="https://cdn.babylonjs.com/babylon.js"></script>

Works here: https://codepen.io/docEdub/pen/KKebrpa

4 Likes

ok thanks , i didnt think to try that because the viewer object has the BABYLON object itself