"Regardless of the mouse filter setting I apply, and in any node hierarchy, be it parent-child or child-parent, the mouse event continues to propagate to underlying nodes. I can't make sense of it.

Whether I set it to Ignore or Stop, it still passes inputs.

When a Control node, TextureRect, or ColorRect is the parent of the button, the input gets through, and the button is pressed.

If the button is the parent of the aforementioned nodes, the result is the same.

Can anyone help me understand what's happening with mouse filters in Godot? It seems impossible to see them working as expected."

  • xyz replied to this.

    kzeta Do you handle events in _gui_input()?

      xyz You should use _gui_input() instead of _input()

      I assume that's only relevant when you're handling the mouse input at a low level. If you're using signals such as Button.button_pressed, then the mouse filter behaves as expected.

      • xyz replied to this.

        DaveTheCoder Yeah, my guess from OPs vague description was that they're using _input(). If that's not the case, best to provide exact node setup and event handling code.

        Being the parent alone isn't enough, a control has to cover another, spatially, to stop mouse events from propagating down to controls beneath it.

        He's saying that because a Control is a child of a Parent with Stop... that he thinks the Stop property would propagate to the children... but that's not how it works. It's just what-covers-what in layered 2D space

        Sometimes I just put a large invisible Control with Stop over top of all the controls I want 'disabled'

        • xyz replied to this.

          davek Being the parent alone isn't enough, a control has to cover another, spatially, to stop mouse events from propagating down to controls beneath it.

          I'd assume that's self evident.

            Maybe it's not self-evident to the OP, since he mentioned "parent" several times.

            • xyz replied to this.

              DaveTheCoder Probably.
              Post your exact scene setup and code if you want this resolved @kzeta, so people don't have to guess.

              xyz something-something assuming things makes an ass of u 'n me, which is why I go around presuming instead...

              • xyz replied to this.

                Megalomaniak This thread is becoming psychoactive. @OP, better provide details or else... 😂