button not responding to mouse

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By droc101

I have a button in my scene, it is set to the stop mode for the mouse filter (idk what this does) and it is not responding to anything, not even changing color on mouse enter… any clue what is going on?

EDIT: This is happening for option buttons too, not just regular ones

Do you have anything overlapping the buttons? Maybe with visibility off?

Magso | 2020-02-29 01:29

No… I don’t think so. I even put in on a canvas layer with layer 100, still didn’t work.

droc101 | 2020-02-29 13:30

To ask the obvious: Disable isn’t checked?

wombatstampede | 2020-02-29 16:06

No, only flat…if that matters

droc101 | 2020-02-29 18:43

I’m sorry and I had somewhat same problem. I paused the game and forgot to set pause process of a button to process -_-

EchoBlur | 2020-12-01 00:47

:bust_in_silhouette: Reply From: MonsterVial

Partly as a reminder to myself… Things to check:

  • Is there anything in front (a.k.a. further down the scene tree) that may be blocking the button? This can include invisible things. Make sure control nodes are set to ‘Mouse > Filter = Ignore’ if you don’t want them to get mouse events.
  • Make sure the button is enabled and has mouse mode set to ‘Stop’. You may also make sure it has the button mask for the mouse buttons you want to use.
  • If you are using _input functions in gdscript, make sure you are not gobbling up that input with get_tree().set_input_as_handled()
  • If you have any viewports in your scene, those may gobble up inputs for things overlapping that viewport. Set the viewport to ‘Gui>Disable Input=true’ to stop it from doing that.
  • If you have any modal windows, make sure those are not set to exclusive. That will keep things outside that modal from being clicked.
  • If you are using a canvas layer with any transformations or with follow viewport turned on, it won’t work. That is currently broken (9/18/2020 Issue: CanvasLayer's Follow Viewport doesn't translate inputs correctly · Issue #35965 · godotengine/godot · GitHub )

Is there anything in front (a.k.a. further down the scene tree) that may be blocking the button? This can include invisible things. Make sure control nodes are set to ‘Mouse > Filter = Ignore’ if you don’t want them to get mouse events.

Never before have I felt so stupid. Thank you.

yerbestpal | 2022-12-13 15:57

My problem was that the Button was not in a CanvasLayer Component

d2clon | 2023-01-26 21:37

1 Like
:bust_in_silhouette: Reply From: rodell2020

please note:
if the button you press loads a scene and that scene has error’s(i.e missing script etc. )
the button will not work.

so as a way to fix that
look at the script file under the button that is not working
make not of the scene it is trying to load.
in the FileSystem try to open the scene it will tell you if it has missing scripts etc. fix the erorr. then save all scenes

:bust_in_silhouette: Reply From: d2clon

In my case, the problem was that the Button Node was not a child of a CanvasLayer Node

:bust_in_silhouette: Reply From: whytry313

In my case, the problem was a total rookie mistake, if at any point the game is paused, loading another scene will not unpause the game unless that new scene pause_mode is set to process. It might sound obvious but while nothing will happen on signals, buttons will still change on hover which can be misleading.

1 Like