# Switching scenarios

**URL:** <https://forum.babylonjs.com/t/switching-scenarios/32097>\
**Category:** Questions\
**Created:** [July 12, 2022, 2:38am UTC](https://forum.babylonjs.com/t/switching-scenarios/32097 "2022-07-12T02:38:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Y.R.R](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/y.r.r/32/34387_2.png) [@Y.R.R](https://forum.babylonjs.com/u/Y.R.R)\
**Post date:** [July 12, 2022, 2:38am UTC](https://forum.babylonjs.com/t/switching-scenarios/32097/1 "2022-07-12T02:38:45Z")

</div>

I finally got some questions when I switched scenes, could you please help me to answer them? When clicking the “drop-down List” button, A “A” “B” “C” “D” dropdown menu will appear, and when clicking the corresponding menu, it will switch to the corresponding scene.

I put PG below, hoping someone can help me out, thank you very much！

> **[Babylon.js Playground](https://playground.babylonjs.com/#WZNAU4%2354)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![rdw1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rdw1/32/9212_2.png) [@rdw1](https://forum.babylonjs.com/u/rdw1)\
**Post date:** [July 12, 2022, 11:48am UTC](https://forum.babylonjs.com/t/switching-scenarios/32097/2 "2022-07-12T11:48:28Z")

</div>

What exactly is your question?

If you want to switch scenes (not scenarios :D), you should unload the old scene by calling `dispose` on it, and then create a new one. You could also simulate the same effect by removing everything from the existing scene. This is what I’m usually doing, though I’m not sure if there are adverse effects if you do it this way.

It’s not clear to me what your Playground is trying to illustrate. Maybe you can produce a simple example to isolate the problem? It’s generally advisable to keep them as simple as possible so that the BabylonJS community can help you more easily. Coming up with the most basic example possible can also help you identify the problem as you remove the parts that aren’t relevant and make it more difficult to understand.

---

<div class="post-metadata">

**Author:** ![Y.R.R](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/y.r.r/32/34387_2.png) [@Y.R.R](https://forum.babylonjs.com/u/Y.R.R)\
**Post date:** [July 13, 2022, 1:35am UTC](https://forum.babylonjs.com/t/switching-scenarios/32097/3 "2022-07-13T01:35:24Z")

</div>

My problem now is that I have three buttons and three scenes. Clicking the button can switch scenes, such as clicking the first button to display the first scene, clicking the second button to display the second scene, and clicking the third button to display the third scene. I tried to write it this way, but it didn’t work 😭

---

<div class="post-metadata">

**Author:** ![rdw1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rdw1/32/9212_2.png) [@rdw1](https://forum.babylonjs.com/u/rdw1)\
**Post date:** [July 13, 2022, 4:08pm UTC](https://forum.babylonjs.com/t/switching-scenarios/32097/4 "2022-07-13T16:08:17Z")

</div>

What exactly isn’t working? I would suggest simplifying the example, remove all the code that isn’t immediately relevant to the problem [of switching scenes], etc 🙂 That way, we will be better able to help you.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 13, 2022, 11:26pm UTC](https://forum.babylonjs.com/t/switching-scenarios/32097/5 "2022-07-13T23:26:17Z")

</div>

The documentation has a simple example of switching between scenes here: [Using Multiple Scenes | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/scene/multiScenes#switch-scenes) 🙂
