+1 vote

I have 2 control nodes one on top of the other both with _gui_input(event) both mouse filters are pass so the gui input should do something then still pass it on. I want both control nodes to detect mouse movement. Is this a bug or am i dumb? If I am dumb please post a answer.

in Engine by (429 points)

Tried it out in a minimal scene and is seems to work. Did you scale both controls to the same size and skipped the accept_event() function?

Both controls are the same size and I did skip the accept event. I think it is a bug because I did it on a minimal seem and it does not seem to work? Not sure how you got it to work.

Simple test:

-Node 2d
--Control 1
--Control 2

Control 1 script:

extends Control
func _gui_input(event):

Control 2 script:

extends Control
func _gui_input(event):

Then both of the filters are set to pass

I see. My try was with a controls as a root node and a second control as its child passing events to its parent. Looks like there are a few issues open about mouse filter, someone mentioned that events according to the docs only propagate up. So one workaround could be to use _input():

func _input(event):
    if event is InputEventMouseMotion:
        if get_rect().has_point(event.position):
            printt(name, event) 

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.