+2 votes

In a container Control Node, I have an regular node and then an area 2D node, like so:

- Control editor_window
    -Node2D gun
        -Area2D gun_base

Now, in a separate scene, I've been able to send a input_event signal from the gun_base to a script in gun (this test scene did not have the control). In this scene, however, I have a script attached to the Control. Here are the relevant parts:

func _ready():
    gun_base = get_node("gun/gun_base")
    gun_base.connect("input_event", self, "select_attachment")

func select_attachment(view, event, shape)
    print("GOT EM")

func _input_event(event):
    DO SOME STUFF, NEVER CALLS accept_event()

I can't ever get GOT EM to print, it just never fires. What have I done wrong? I feel like any event goes to _input_event and never propagates further.

in Engine by (24 points)

1 Answer

+2 votes

There is an option named "Stop Mouse" in inspector when Control node is selected.
This option is mostly "On" by default which prevent to spread mouse event.
Try this option "Off"

by (9,674 points)

Unfortunately, it already is off. If I'm not mistaken, if accept_event is not called, a a ray is cast into the scene and triggers the the input_event on the collision object (in this case, the Area2D object)

For me, turning off "Ignore mouse" helped.

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.