In Godot 4, await is the single GDScript feature that flattens the messiest part of your codebase. It replaces signal-callback chains with linear top-to-bottom code, and it's still the first thing most tutorials skip past on their way to the next node-tree screenshot.
This is a quick tour of where await actually pays off, with code you can paste into a 2D project today.
The shape of await in GDScript
call this exact pattern out as the supported way to do "fire and forget" delays.
2. Sequencing animations
func play_intro():
await $AnimationPlayer.animation_finished
$AnimationPlayer.play("zoom_in")
await $AnimationPlayer.animation_finished
$AnimationPlayer.play("fade_out")
await $AnimationPlayer.animation_finished
queue_free()
Three animations in sequence, in eight lines, with no nested callbacks. The pre-await version of this code is what most "how to chain animations in Godot" tutorials ship, and it is twice as long with three times the bug surface.
3. Waiting on player input inside a coroutine
func wait_for_jump():
while true:
var event = await Input.input_event
if event.is_action_pressed("jump"):
return
This is what tutorial games and dialogue systems actually need: pause execution until the player presses a specific key, then resume. Without await, this is a _input handler plus a state flag plus a polling check.
4. Turn-based game flow
Reddit user heyitsdoodler filed with a four-element array; awaiting on the signal gets you exactly that array back.
The gotchas every tutorial leaves out
Awaiting a signal on a freed object hangs forever. If you await some_node.signal_name and then queue_free() the node before the signal fires, your coroutine never resumes. Wrap critical awaits in a timeout pattern using any()-style helpers, or check is_instance_valid() after the await returns.
Coroutines do not catch exceptions across the yield. A push_error() before the await fires normally, but a runtime crash in the resumed half is reported with a partial stack trace. Profile suspicious sequences with that live inside the Godot editor see your actual signals and emit await-based code; generic tools fall back to whatever pattern is most common in their training set.
When to skip await
Two cases:
Hot per-frame code. Use_processor_physics_processfor things that need to run every frame.awaitis for sequenced one-shot logic, not animation curves.
Cross-scene communication. A signal connected throughconnect()is still the right answer when two unrelated nodes need to talk to each other reactively.awaitworks inside one coroutine;connectis the pub-sub between systems.
The mental model that works: await is for code that reads top-to-bottom but needs to wait. connect is for code that reacts whenever something happens.
The short version
Use await for timers, animations, input prompts, turn order, and HTTP. Wrap critical awaits in timeout helpers. Watch out for freed nodes. Set defaults before awaiting in _ready. And if your AI assistant still emits connect("pressed", _on_pressed) chains for these patterns, it's reading from a 2021 tutorial.
SOCIAL SHARE CARD GENERATOR