How to make button from unrendered scene not being clickable?

Hi everyone,

When I switch between two scenes, the button from the not-rendered scene, which is not visible on the screen, and not available in the inspector is still clickable.
PG example
How to reproduce:
Press the green button. When the scene switch happens, press again in the location when the green button was before. You will see the message in console that click event happened.

Please advise how to avoid that behavior and make not rendered buttons inactive = not clickable?

Regards,
Roman

1 Like

Hi,

You can use

button.isPointerBlocker = true/false

true when you want to detect ponter events and false when you don’t want to do that

https://playground.babylonjs.com/#MXCRPS#220 (lines 30 and 67)

6 Likes