godot-signals-groups
Agent skill fromgamedev-skills/awesome-gamedev-agent-skills
Build event-driven, decoupled Godot 4.7 gameplay with signals and node groups: declare and emit custom signals, connect with Callables (incl. bind/one-shot), and broadcast to many nodes via groups and call_group. Use when wiring node communication in a Godot project, replacing tight references with signals, emitting/connecting events, or porting 3.x connect("sig", self, "method") code.
How to install godot-signals-groups
install godot-signals-groups
# install the awesome-gamedev-agent-skills pack with the skills CLI
npx skills add gamedev-skills/awesome-gamedev-agent-skills# or add only this skill to Claude Code: copy the folder
skills/godot/godot-signals-groups/
# into
~/.claude/skills/godot-signals-groups/ (all projects)
.claude/skills/godot-signals-groups/ (one project)
1# Godot Signals & Groups (4.x)23Decouple nodes with the observer pattern (signals) and act on many nodes at once4(groups), instead of hard-coding references between scenes. Targets **Godot 4.7**.56## When to use78- Use when a node needs to tell others "something happened" (player died, item picked9 up, wave cleared) without holding direct references to them.10- Use when you need to address a whole category of nodes at once ("pause all enemies",11 "save every checkpoint").1213**When *not* to use:** raw signal *syntax* basics → `godot-gdscript`; scene structure14and instancing → `godot-nodes-scenes`. For cross-scene global events, emit from an15autoload (see `godot-nodes-scenes`).1617## Core workflow18191. **Decide the direction.** A child/sub-scene should *emit* a signal upward; the parent20 *connects* to it. This keeps the child reusable and ignorant of who listens.212. **Declare typed signals** on the emitter; `emit()` them when the event occurs.223. **Connect with a Callable** (`sig.connect(_on_sig)`), optionally in the editor's Node23 dock. Use `CONNECT_ONE_SHOT` for fire-once, `bind()` to pass extra context.244. **Use groups for broadcast**: add nodes to a named group, then iterate25 `get_tree().get_nodes_in_group(...)` or `call_group(...)`.265. **Disconnect when needed** (e.g. before freeing a long-lived listener) and check27 `is_connected()` to avoid duplicate connections.2829## Patterns3031### 1. Emit upward, connect from the parent3233```gdscript34…
Excerpt shown under the repository's Apache-2.0 license.
