Download

Problem: Button Won't Detect Mouse

My problem is this: I have a working inventory system that properly displays the items and the OnClicked event for each slot works. When it’s clicked, I want an action menu to appear that has buttons such as Use, Split Stack, Drop and Cancel. Currently, when a slot is clicked it displays the menu and updates it, so if the item cannot be used it doesn’t have the use button and so on. But whenever I try and click these buttons it doesn’t detect it. I’ve set the disabled colour to bright red and the buttons aren’t disabled. They don’t change appearance on hover either; I don’t understand what the problem is, and I can’t find a solution.

Here are some screenshots:


​​​​​​​
​​​​​​​

Any help will be appreciated, thanks in advance.

You just have a visibility or a z-order problem. These are settings displayed on each of the widgets you add in your ‘Designer’ tab.

z-order is the layering order of your widgets. The higher the more on top it is (if I remember correctly).

Widgets are layered using this order + the order at which you put them in your widget hierarchy (which means inside the z-order 0, the widgets which is on top is the widget at the bottom of the widget hierarchy you created).

If you create several widgets with the same z-order on top of each other from different places in your code, the latest created will be on top of the others.

Visibility has different settings:
Hidden - can not consume mouse clicks, is not rendered on screen, does not calculate tick and anims
Collapsed - same than above but removes the room it takes up in the widget as well
Self Hit Test Invisible - this widget will not respond to click events
Hit Test Invisible - this widget and all widgets attached to it will not respond to click events
Visible - everything works!

To me you just have a z-order problem: something invisible / with 0 opacity is in front of your button and is preventing your mouse to detect it.

Simply remove everything but your button and see if it works.

If it doesn’t, it means you have a visibility setting issue: something is not setup properly (check out your visibility settings and see if it makes sense according to the description I gave you).

If you want more details, quote me with my name (it will generate a notification for me).

I’ve tried everything and I can’t get it to work; I’ve set its z-order to a high number, checked all of its visibility settings and nothing has worked. It’s also affecting how I can work on my game because all futures rely on this feature. I don’t know what to do, what do you think?

Hey!
First of i would suggest the use of overlays. Also are the Action Menu’s behaviors set properly? And inside the action menu the thing that has the behavior set on…is it visible?

The problem I’ve been having is that the action menu doesn’t even detect the mouse so it doesn’t change with hovering over it. It is on visible and appears properly, so by behaviors I’m assuming that you mean the events for OnClicked, OnHovered, etc.

We need to see your Action Menu designer tab (where we can see the widget hierarchy). One of the widget in this hierarchy is blocking the hit mouse (probably the box which contains the button has its visibility set to “Visible” therefore preventing clicks from happening, if it’s the case, set it to “Self Hit Test Invisible” instead).

Turns out I had one of the parts of the action menu set to HitTestInvisible rather than SelfHitTestInvisible, I feel really stupid but it’s fixed now. Thanks XD