Pulse Works Studio

Invalid type in function 'connect' in base 'Node'. Cannot convert argument 2 from String to Callable.

Node.connect no longer takes a target and a method name string.

Cause

Godot 4's connect takes a signal name and a Callable. The Godot 3 call connect("timeout", self, "_on_timeout") puts a String in the Callable slot, and the VM rejects the conversion. Connecting from the signal itself, timeout.connect(_on_timeout), is the usual form.

Fix

func _ready() -> void:
	$Timer.timeout.connect(_on_timeout)

func _on_timeout() -> void:
	print("done")

Related

Godot Dev Tools is a Pulse Works Studio project. All error explainers.