# \[WebXR\] BABYLON GUI Button doesnt work in ar-session if HardwareScalingLevel is changed

**URL:** <https://forum.babylonjs.com/t/webxr-babylon-gui-button-doesnt-work-in-ar-session-if-hardwarescalinglevel-is-changed/16233>\
**Category:** Bugs\
**Tags:** gui\
**Created:** [December 2, 2020, 1:07pm UTC](https://forum.babylonjs.com/t/webxr-babylon-gui-button-doesnt-work-in-ar-session-if-hardwarescalinglevel-is-changed/16233 "2020-12-02T13:07:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlie](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Charlie](https://forum.babylonjs.com/u/Charlie)\
**Post date:** [December 2, 2020, 1:07pm UTC](https://forum.babylonjs.com/t/webxr-babylon-gui-button-doesnt-work-in-ar-session-if-hardwarescalinglevel-is-changed/16233/1 "2020-12-02T13:07:35Z")

</div>

When I change the engine hardware scaling level, I can no longer interact with the GUI elements within a WebXR ar-session. This can be tested in the below playground by un/commenting the engine.setHardwareScalingLevel(2);

Playground: [https://playground.babylonjs.com/#F41V6N#155](https://playground.babylonjs.com/#F41V6N#155)

If anyone has any suggestions on how I could get around this issue then please let me know!  
Thanks

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 2, 2020, 1:41pm UTC](https://forum.babylonjs.com/t/webxr-babylon-gui-button-doesnt-work-in-ar-session-if-hardwarescalinglevel-is-changed/16233/2 "2020-12-02T13:41:15Z")

</div>

Adding @RaananW about the XR as he is our own XR king 🙂

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [December 2, 2020, 1:55pm UTC](https://forum.babylonjs.com/t/webxr-babylon-gui-button-doesnt-work-in-ar-session-if-hardwarescalinglevel-is-changed/16233/3 "2020-12-02T13:55:35Z")

</div>

Hardware scale works on the original canvas, but WebXR uses a different one. If you want to keep the hardware scaling (which i would suggest against, due to the way XR works), you can pass the value to XR to let the renderer know that you want hardware scaling in XR as well.

To do that pass framebufferScaleFactor when generating the XR experience helper, for example like this:

[Babylon.js Playground](https://playground.babylonjs.com/#5EQA9Y#4)

If I may ask - Why do you want to change the hardware scaling in AR mode? the camera input won’t change anyhow.

---

<div class="post-metadata">

**Author:** ![Charlie](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Charlie](https://forum.babylonjs.com/u/Charlie)\
**Post date:** [December 2, 2020, 4:10pm UTC](https://forum.babylonjs.com/t/webxr-babylon-gui-button-doesnt-work-in-ar-session-if-hardwarescalinglevel-is-changed/16233/4 "2020-12-02T16:10:08Z")

</div>

Hi RaananW,

Thanks for the explanation, I have a better understanding now.

I didn’t necessarily want hardware scaling in the AR mode, I was using the optimizer to improve the app’s performance for the user when they are not using the AR mode. Then I noticed the issue where some devices couldn’t use the GUI elements in the AR mode and I saw that hardware scaling was causing this.

I now have it to reset the hardware scaling when the AR mode is active and that pretty much solves the issue.

Thanks again for helping me out!
