Button's visibility on/off makes the button unclickable.

A simple Restart button that would reload the scene is by default set to button_node.visible = false

When the game is lost the button is set to be visible and when pressed would restart the scene.

The problem is, the button works fine without the visibility settings but once its visibility is changed, it can no longer be clickable despite being visible on the screen once the game losing condition is met.

The problem persists with or without a control node as its parent.

Debugging confirms that the button works just fine before the visibility settings are added.

Am I missing something ? :thinking:

Why would a button become unclickable oce its visibility is changed?

There may be another Control on top of it consuming the event. Check which Control is consuming the event by clicking on it while the game is running and check the Misc tab in the Debugger dock. Check if Last Clicked Control field shows anything. If it does, set that control Control.mouse_filter to Ignore and repeat.

1 Like

Thank you so much for taking the time to answer my question.

I never knew much about the Misc tab in the debugger dock, that alone is an eye opener and I appreciate it.

I managed to solve the problem by changing the mouse_filter on the Button to “pass” and voilà, problem magically solved!

I have little to no knowledge about control nodes since the Restart button I was working on was simply a final step UI feature that I wanted to add quickly to finish the project.

Apparently there’s much to learn about control nodes and when that happens, I’ll understand why exactly it worked.

Thank you nonetheless, hat’s off!