ran into these a bunch lately so figured i’d share in case it saves someone some time.
-
spawning stuff inside body_entered gives “Can’t change this state while flushing queries”. use
add_child.call_deferred(coin)instead, andset_deferred("monitoring", false)if you’re turning an area off. -
with
.bind(), your bound values go after the signal’s own args. soitem_selected.connect(_on_item_selected.bind("weapon"))needsfunc _on_item_selected(index: int, slot: String). flip them and it errors and never runs. -
long paths like
$HUD/MarginContainer/HealthBarbreak the second you move nodes around. right click the node, pick Access as Unique Name, then use%HealthBar. also if a signal is already connected in the editor, don’t connect it again in code or it fires twice.
i kept hitting these with AI tools too, so i made a free set of rules for them if anyone wants it: GitHub - scoyoc5/godot-ai-agent-rules: Free Cursor rules + AGENTS.md that stop AI (Cursor, Claude Code, ChatGPT) from writing Godot 3 code in Godot 4 projects: yield, export, onready, old connect(), invented APIs. MIT. · GitHub