This is called from the player.gd file, within one of the processes: mode_change is defined as "signal mode_change(new_mode)" The mode_change signal is connected to the GUI.gd file, pictured here: When doing emit_signal() with more than one argument, the compiler complains about too many arguments, and this is the only code that does not cause errors. However, the mode does not change when I press the respective button. What is going wrong?

I defined it before any of this, but thought that it would be a waste of space to put that, so I included its definition in quotes just after the first photo.

In that case in your emit signal you must include your argument too: emit_signal("mode_change", new_mode_here)

As mentioned in the question, when I try that the compiler throws an error saying that the emit_signal() function only expects one parameter.

Try putting this at the top of every script that is involved in the signal (connect or emit):

signal mode_change

On the GUI script:

player.connect("mode_change", self, "change_label")

On player script:

emit_signal("mode_change", mode)

I'm fairly sure that will work.

That's good except for the first code fragment.

signal mode_changed(mode) # forgot parameter

I just tried it on my project, that is not needed.

Alright, thank you all, the solution that worked was, oddly, removing the array of parameters from the player.connect() function within GUI.gd. It seems the 4th argument of connect() is for variables passed within the same node, and not for signals to pass variables with their emission.

3 years later