# GUI buttons no more working after changing cameras viewport

**URL:** <https://forum.babylonjs.com/t/gui-buttons-no-more-working-after-changing-cameras-viewport/38330>\
**Category:** Questions\
**Created:** [February 17, 2023, 9:51pm UTC](https://forum.babylonjs.com/t/gui-buttons-no-more-working-after-changing-cameras-viewport/38330 "2023-02-17T21:51:24Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Fenryll](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fenryll/32/2677_2.png) [@Fenryll](https://forum.babylonjs.com/u/Fenryll)\
**Post date:** [February 18, 2023, 2:46pm UTC](https://forum.babylonjs.com/t/gui-buttons-no-more-working-after-changing-cameras-viewport/38330/6 "2023-02-18T14:46:27Z")

</div>

Okay, with your help, I am moving forward:

- I understood thanks to one of your post, Mawa, that the order the cameras are added to the `scene.activeCameras`, matters, actually, crossing with what Evgeni\_Popov wrote, I think the last camera added becomes the `scene.cameraToUseForPointers`
- I understood thanks to deltakosh’s answer in this [post](https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938/3) that I can use `AdvancedDynamicTexture.scaleTo` to adjust the 2d controls: I ajdust it to the canvas size times the viewport size (which is in percent): `this.advancedTexture.scaleTo(this.canvas.width*this.camera.viewport.width, this.canvas.height);` and the result is good, no more distortion.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/c/ec1b3ca85673317997ff987920c065daaddbd655.jpeg)

Almost there 🙂

But now I would like:

- to have the pointers on the cards working on the left camera
- to have the menu buttons icons (settings, fullscreen, close): only displayed on the right camera and enabled…

Is this possible ? if only one camera at a time can use pointers, then I would remove them from the right camera and le them on the left one.

Finally, with the layerMasks: how can I keep all the meshes on both camera except these menu buttons ?

If no solution, I might go with an html div overlay, like the chat on the low left corner…

---

_[View the full topic](https://forum.babylonjs.com/t/gui-buttons-no-more-working-after-changing-cameras-viewport/38330)._
