+1 vote

I want to connect a signal in a script but I get the following error:

SCRIPT ERROR: Parse Error: Invalid argument for "connect()" function: argument 2 should be Callable but is res://characters/EnemySpawner.gd

This is the code:

enemy.connect("enemy_died", self, "score")

Godot version 4.0
in Engine by (20 points)

3 Answers

–3 votes

Godot 4.0 is pre-alpha software. It is not ready for use, and does not work in the same way as 3.x. You should not be using it if you are a beginner.

by (21,712 points)

I hear what you are saying but there are many reasons to begin with the latest beta version of a software product. Regardless of whether or not the user is a beginner, there is nothing wrong with asking for clarifications about differences between versions. If anything, I believe these kinds of questions help both users of the product, and developers seeking to improve the software and documentation.

0 votes

I know my answer is two months late, but I hope it helps someone

I think it is now

$objectname.signal.connect(func() : pass)


$enemy.enemy_died.connect(func() : do something)

the example above was inline

here is an example with the other way

var onEnemyDied = func():
    pass #do something

by (57 points)
+4 votes

I think this might help you.

$Button.connect("pressed", self, "_on_button_pressed")

will become


To make a signal with additional arguments, you would use the new Callable.bind():

$Button.pressed.connect(self._on_button_pressed.bind("Hello", "World"))

Signals will now have their own class, and therefore their own methods. This includes the ability to emit signals through code:


Disconnect signals:


Get all current connections:


Check if the signal is connected:

by (95 points)

Thank you, this helped me!

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.