Skip to content
Loadout

Fix

Godot 4 signal connect: Callable, not a string

Answer

In Godot 4 connect a signal with a Callable: button.pressed.connect(_on_pressed). Do not pass a signal name, a target, and a method string to connect. Emit with hit.emit(amount), not emit_signal.

  • Godot 4.7.2-stable (18 August 2026)
  • GDScript 2.0

Last verified 2026-10-15

Agents still paste the Godot 3 connect call, with a signal name, a target, and a method name. The Godot 4 pack is written to stop that paste. It is pinned to Godot 4.7.2-stable (18 August 2026) and GDScript 2.0. The rename table on /fixes/godot-3-code-in-godot-4 bans connect("pressed", self, "_on_pressed") and emit_signal("hit", n). Movement and delta are /fixes/godot-4-move-and-slide-and-delta. This page is the signals section of the same rules file.

The recommended call is Signal.connect, not Object.connect. button.pressed.connect(_on_pressed) passes the method as a Callable. The stable Godot 4.7 Signal class page calls that the recommended and fastest option: a missing signal or a missing callable is a compile-time error, not only a runtime error. Object.connect("pressed", _on_pressed) and button.pressed.connect(Callable(self, "_on_pressed")) still exist. Those forms check the names at runtime. Use a string only when the name comes from data, such as a configuration file. Otherwise call connect on the signal.

The upgrade guide says the Godot 3 connection syntax changed. The conversion tool writes the string-based syntax, which is still present in Godot 4, and recommends the Signal-based syntax so a wrong name is not a runtime-only error. Godot 4 Object.connect takes a StringName and a Callable. The Godot 3 call that passes a target and a method string does not match that signature. That three-argument form is the one the pack bans.

Declare the signal as signal hit(amount: int). Emit with hit.emit(amount). Object.emit_signal still exists and takes the name as a string. The pack bans emit_signal("hit", n). Disconnect with pressed.disconnect(_on_pressed). A signal can be connected once to the same Callable. Connecting it again returns ERR_INVALID_PARAMETER unless the connection used CONNECT_REFERENCE_COUNTED. Check is_connected first. Extra arguments go through Callable.bind, and arguments passed to emit come first. If the callable's object is freed, the connection is lost. Checked against https://docs.godotengine.org/en/stable/classes/class_signal.html.

Last verified 2026-10-15. doc-verified; GDScript sample parsed by Godot 4.7.2 headless (--check-only), with a Godot 3 control script correctly rejected.

Pro

Godot 4 Pro rules, $1+

$1+ · pay what you want

Multiplayer API, GDExtension and C#, user:// saves, and export templates. Deeper than the free Godot 4 pack.

Each pack ships as AGENTS.md, CLAUDE.md, Cursor .mdc, and Copilot instructions, with 12 months of free updates.

From the Godot 4 Pro rules

Create an `ENetMultiplayerPeer`, call `create_server(port)` or `create_client(address, port)`, then assign `multiplayer.multiplayer_peer`. ENet is UDP. Do not use Godot 3's `NetworkedMultiplayerENet`.
Declare an RPC with `@rpc` on the function. The default is `@rpc("authority", "call_remote", "reliable", 0)`. Call `method.rpc()` for every peer, or `method.rpc_id(1)` for the server. Peer id 1 is the server. Do not call the Godot 3 form `rpc("method_name", args)`.
The same RPC must exist on the server and the client, on the same node path, with the same `@rpc` declaration and the same return type. Godot checksums the whole script. A function that exists on only one side fails that check.
A client request uses `@rpc("any_peer", ...)`. Read `multiplayer.get_remote_sender_id()` on the server and do not trust the payload for identity. Check `multiplayer.is_server()` before changing shared game state.
Godot 4 Pro rules, $1+

Godot 4 pack — GDScript 2.0 rules that refuse Godot 3 APIs.

doc-verified; GDScript sample parsed by Godot 4.7.2 headless (--check-only), with a Godot 3 control script correctly rejected

Sources in the pack

Docs

Questions

How do I connect a signal in Godot 4?
In Godot 4 connect a signal with a Callable: button.pressed.connect(_on_pressed). Do not pass a signal name, a target, and a method string to connect. Emit with hit.emit(amount), not emit_signal.
Does Object.connect still work in Godot 4?
Yes. Object.connect(signal_name, callable) is the string-based form, and it validates names at runtime. Signal.connect, written button.pressed.connect(_on_pressed), is the recommended and fastest call. The Godot 3 form connect("pressed", self, "_on_pressed") does not match the Godot 4 signature.
Was emit_signal removed in Godot 4?
No. Object.emit_signal still exists. The recommended call is hit.emit(amount). The pack bans emit_signal("hit", n). Declare the signal as signal hit(amount: int).
When was this Godot 4 signal rule last checked?
Last verified 2026-10-15. doc-verified; GDScript sample parsed by Godot 4.7.2 headless (--check-only), with a Godot 3 control script correctly rejected.