Button nodes aren't responding to mouse clicks, could someone help me out?

BlackAxolotlGamesBlackAxolotlGames Posts: 3Member
in GUI

I'm creating my Title screen for my game and the buttons I'm using for it aren't responding to mouse clicks but do respond if shortcuts are specified for them. I've tried searching around before asking this question and couldn't find an answer to my problem.
For reference here is my node structure:

the code on my title screen:

and the code on my buttons:

Best Answer

  • Accepted Answer

    So I eventually found the issue, the issue I was having was I was autoloading a scene that had a canvas layer covering the whole screen and that was what was blocking the buttons from being clicked. after removing the canvas layer and restructuring that scene, all of my buttons were clickable

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,635Admin

    Welcome to the forums @BlackAxolotlGames!

    If I had to guess, it is probably the Fade In node blocking the mouse cursor. I don't remember what the setting is right off, but there should be a setting called something like mouse filter that you can set that will allow input events from the mouse to pass through it, which should fix the issue.

  • BlackAxolotlGamesBlackAxolotlGames Posts: 3Member

    Thanks for the welcome @TwistedTwigleg

    I worked on changing the mouse filters in every possible way I could and there were no changes
    I've narrowed the issue down a bit more since I made my post
    the issue seems to be that the button nodes can see/recognize the mouse at all, hover over animations don't take effect which I can take to mean that the buttons can't "see" the mouse for one reason or another.
    I have tried running the base button scene and it has the same effect, no response.
    and to make sure that I'm not missing the pressed event I have added print("Pressed") to the function for when the button is pressed inside of the button script

    here is the way the button is structured for reference:

  • BlackAxolotlGamesBlackAxolotlGames Posts: 3Member
    Accepted Answer

    So I eventually found the issue, the issue I was having was I was autoloading a scene that had a canvas layer covering the whole screen and that was what was blocking the buttons from being clicked. after removing the canvas layer and restructuring that scene, all of my buttons were clickable

  • TwistedTwiglegTwistedTwigleg Posts: 2,635Admin

    Awesome! I'm glad you were able to figure it out :smile:

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file