# 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:** 4

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [February 18, 2023, 8:16am UTC](https://forum.babylonjs.com/t/gui-buttons-no-more-working-after-changing-cameras-viewport/38330/4 "2023-02-18T08:16:46Z")

</div>

Would you have a PG to share? Even just a simplified version? I believe your issue does come from the way you are handling cameras and layerMask. I also think this is totally achievable (but without the PG, I would need to reproduce it from scratch and I don’t really feel like it (sry).

I can however make a couple of assumptions for your issues:

> [@Fenryll](#):
>
> the 2d UI is deformed

Likely because it is expressed in percentage mode. When you resize your ADT to 50% of the width, controls are resized to the size of the container

> [@Fenryll](#):
>
> and no more clickable

Likely a layerMask and/or camera order issue.

> [@Fenryll](#):
>
> the cards are no more clickable

Same as above. Although it could also be a pointerBlocker issue. Depends on how your ADT is built.

> [@Fenryll](#):
>
> the UI is displayed on both camera

Again, layerMasks and camera controls are key here…

**Edit:** I fixed something similar just lately, may be it can help (else, as I said, give me the PG and I shall have a look at it)

> [@Hover work without GUI but dont work with (cameraGUI obligatory for dont double GUI on mini camera)](https://forum.babylonjs.com/t/hover-work-without-gui-but-dont-work-with-cameragui-obligatory-for-dont-double-gui-on-mini-camera/38110):
>
> [[hover work without GUI but dont work with (cameraGUI obligatory for dont double GUI on mini camera)] ](https://www.youtube.com/watch?v=71du4VmZ6jU) code: (click on corner right for look code) [https://codepen.io/joffrey-courty/pen/xxJvgVL](https://codepen.io/joffrey-courty/pen/xxJvgVL)

There are also some more info for layerMasks in this post (and more to come in the doc soon to extend this section for ‘[in-depth layerMask](https://doc.babylonjs.com/features/featuresDeepDive/scene/layermask)’)

> [@Mask and RenderingGroup don't work, rectangle and cube visible by two cameras not only one](https://forum.babylonjs.com/t/mask-and-renderinggroup-dont-work-rectangle-and-cube-visible-by-two-cameras-not-only-one/37484):
>
> line : 371 and 377. Thanks \<3 / PS : click on corner right for look code

---

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