# DevTools access scene

**URL:** <https://forum.babylonjs.com/t/devtools-access-scene/26894>\
**Category:** Questions\
**Tags:** typescript, npm, localdev\
**Created:** [January 19, 2022, 1:01am UTC](https://forum.babylonjs.com/t/devtools-access-scene/26894 "2022-01-19T01:01:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pieter\_van\_Stee](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pieter_van_stee/32/20145_2.png) [@Pieter\_van\_Stee](https://forum.babylonjs.com/u/Pieter_van_Stee)\
**Post date:** [January 19, 2022, 1:01am UTC](https://forum.babylonjs.com/t/devtools-access-scene/26894/1 "2022-01-19T01:01:48Z")

</div>

Hi there,

I’ve switched to typescript on a local dev (npm install) for a few weeks now, up till now goes very well.  
However, before when working with the referenced cdn script path in the html file I could list my options for objects in the DevTools from chrome.

I could for example enter scene, or scene.activeCamera to get my active camera.

```auto
VM17723:1 Uncaught ReferenceError: scene is not defined
    at <anonymous>:1:1

```

This now returns this error.

What’s the way to access this again in this workflow?  
Thanks!

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [January 19, 2022, 1:38am UTC](https://forum.babylonjs.com/t/devtools-access-scene/26894/2 "2022-01-19T01:38:12Z")

</div>

Possible reason is that now you call your objects listing snippet before the scene is initialized.  
Or, probably, you need to use `this.scene` ?  
Hard to say without seeing the actual code 🙂

---

<div class="post-metadata">

**Author:** ![jeremy-coleman](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jeremy-coleman/32/15493_2.png) [@jeremy-coleman](https://forum.babylonjs.com/u/jeremy-coleman)\
**Post date:** [January 19, 2022, 2:06am UTC](https://forum.babylonjs.com/t/devtools-access-scene/26894/3 "2022-01-19T02:06:45Z")

</div>

Try setting window.BABYLON = BABYLON in your index/entry file.

If that doesnt work, you can configure your bundler to not bundle babylon so that you can still use the cdn script.

---

<div class="post-metadata">

**Author:** ![Blake](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blake/32/21509_2.png) [@Blake](https://forum.babylonjs.com/u/Blake)\
**Post date:** [January 19, 2022, 2:15am UTC](https://forum.babylonjs.com/t/devtools-access-scene/26894/4 "2022-01-19T02:15:24Z")

</div>

On the playground window.scene is set equal to the scene object returned from your scene creating function, so you can type scene in the console to log and inspect the object.

On a local typescript project you should be able to do something like below after creating your scene and then you can access it from anywhere including from the console. Not sure but I think that’s what you’re after? 🙂

```auto
(window as any).scene = scene;

```

---

<div class="post-metadata">

**Author:** ![Pieter\_van\_Stee](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pieter_van_stee/32/20145_2.png) [@Pieter\_van\_Stee](https://forum.babylonjs.com/u/Pieter_van_Stee)\
**Post date:** [January 19, 2022, 9:08am UTC](https://forum.babylonjs.com/t/devtools-access-scene/26894/5 "2022-01-19T09:08:31Z")

</div>

Thank you for all of your answers.  
Only

```auto
(windows as any).scene = scene;

```

worked to be able to access the scene properties in the console of chrome.
