0 votes

I have two LineEdit Controls (FireValue and FireStart) and want to get the value when FireValue changes into FireStart. I want to use Signals to do this. I want to keep my code organized so that FireValue does an emit_signal() and FireStart does the connect() and callback _set_fire().

Why doesn't the callback _set_fire() receive the signal when focus is exited in FireValue?

I know it works if I put all the code in Control1.gd but why does it not work when I have the split? Here is the code. Tested on both 3.1 and 3.2 Mac OS X.

extends LineEdit
signal fire

func _ready():

func _on_FireValue_focus_exited(extra_arg_0: String) -> void:
    pass # Replace with function body.

extends LineEdit
signal fire

func _ready():

func _set_fire(s):

Project Screen shot

enter image description here

in Engine by (805 points)
edited by

1 Answer

0 votes
Best answer

Answering my own question. It seems you also need to specify the connect() method of the source node in this case FireValue.

E.g. Need to do this:


You need to know you are subscribing to that Nodes signals.

by (805 points)
selected by

Yeah, that's one of the necessities of signals. :-/

you can also make the connection via editor where the signal is defined, so the paths get corrected in case of a scene refactor (which is common for UI).

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 Frequently asked questions and 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 [email protected] with your username.