isPointerBlocker and GUI

I have an app where I have a top menu with sub menus and a left toolbar. When the menu is displayed and I clicked a menu item the button in the left toolbar under the menu item I clicked is also triggered. I set isPointerBlocker=true to all the menu items.

Any ideas why this would be happening?

Here is a playground with my menu and left bar classes that create the GUI

From that description, I’d check the GUI hierarchy first. isPointerBlocker may be set on the menu items, but if the menu root or overlay isn’t blocking too, the toolbar underneath can still end up seeing the click.

In my playground version I added isPointBlocker to every GUI item in the menu and it still does the same thing.

It’s an ugly hack but it works. When the menu is shown I hide the left toolbar and when the menu is closed or an item is clicked I show the left toolbar. This will work until I can find an actual solution for it.

Hi @Trevor_Orr, it looks like the left toolbar and the menu bar are in separate AdvancedDynamicTexture instances, so they are both getting the mouse events. Could you refactor to have a single AdvancedDynamicTexture and use zIndex to get the overlay effect you are going for?

I was not aware that is how AdvancedDynamicTexture work. That is an easy update since I already set zIndex. That worked perfectly.

Great, glad I could help!

Hours of debugging and searching and so called AI help and your suggestion fixed it in 15 minutes