# Multiple scenes, one interface

**URL:** <https://forum.babylonjs.com/t/multiple-scenes-one-interface/25224>\
**Category:** Questions\
**Created:** [November 12, 2021, 5:42pm UTC](https://forum.babylonjs.com/t/multiple-scenes-one-interface/25224 "2021-11-12T17:42:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IPcorp](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ipcorp/32/18593_2.png) [@IPcorp](https://forum.babylonjs.com/u/IPcorp)\
**Post date:** [November 12, 2021, 5:42pm UTC](https://forum.babylonjs.com/t/multiple-scenes-one-interface/25224/1 "2021-11-12T17:42:51Z")

</div>

It’s a bit simplistic, but the point is the same. [Playground](https://playground.babylonjs.com/#KV1GWF).  
Two identical scenes and a different object in each. Create gui. If we bind it to scene1, then the mouse events will still affect scene2 (press the mouse button and move). If we bind to scene2, they will affect scene1. Question. How can we configure our interface so that it does not skip events as it should, regardless of how many scenes there are?

---

<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:** [November 12, 2021, 6:35pm UTC](https://forum.babylonjs.com/t/multiple-scenes-one-interface/25224/2 "2021-11-12T18:35:49Z")

</div>

Hello and welcome to the Babylon community!

Do you want the camera on both scenes to move when you click the button? Or neither camera to move?

For the first case, you can set `button.isPointerBlocker` to false so that the GUI button lets the event go through to the camera: [Multiple scenes, one interface. | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#KV1GWF#1)

For the second case, you can detach the controls on the first camera when the button is pressed, and attach them again when the button stops being pressed: [Multiple scenes, one interface. | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#KV1GWF#2)

---

<div class="post-metadata">

**Author:** ![IPcorp](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ipcorp/32/18593_2.png) [@IPcorp](https://forum.babylonjs.com/u/IPcorp)\
**Post date:** [November 12, 2021, 7:02pm UTC](https://forum.babylonjs.com/t/multiple-scenes-one-interface/25224/3 "2021-11-12T19:02:19Z")

</div>

Hello!

Yes, that’s the second case. I’ve recently started working with the engine, and I’m reading the documentation. I thought I might have missed something somewhere. Was hoping there was some sort of flag to solve the problem, as in the first case. Just

> GUI.isPointerBlocker = true

or something like that. Thank you for your reply! I will use event handlers.

---

<div class="post-metadata">

**Author:** ![IPcorp](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ipcorp/32/18593_2.png) [@IPcorp](https://forum.babylonjs.com/u/IPcorp)\
**Post date:** [November 12, 2021, 10:32pm UTC](https://forum.babylonjs.com/t/multiple-scenes-one-interface/25224/4 "2021-11-12T22:32:28Z")

</div>

In continuation of the theme and the problem. In my case a lot of GUI elements, many are created asynchronously upon the occurrence of certain events. Assigning a handler to each one is a bit boring. As an option, maybe someone else will find it useful (couldn’t find a better one):

```auto
myGUI.onControlPickedObservable.add(e => {
        if (e.name != "root") {
            camera1.detachControl();
            e.onPointerUpObservable.addOnce(() => camera1.attachControl(canvas, true));
        }
    });

```

[Playground](https://playground.babylonjs.com/#KV1GWF#3)
