# Godot Signals Groups

Build event-driven, decoupled Godot 4.7 gameplay with signals and node groups: declare...

- Repository: https://github.com/gamedev-skills/awesome-gamedev-agent-skills (6445 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-10-28
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-signals-groups -g -a claude-code -y`
Codex: `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-signals-groups -g -a codex -y`
Cursor: `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-signals-groups -g -a cursor -y`
Gemini CLI: `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-signals-groups -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add gamedev-skills/awesome-gamedev-agent-skills`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Godot Signals & Groups (4.x)

Decouple nodes with the observer pattern (signals) and act on many nodes at once
(groups), instead of hard-coding references between scenes. Targets **Godot 4.7**.

## When to use

- Use when a node needs to tell others "something happened" (player died, item picked
  up, wave cleared) without holding direct references to them.
- Use when you need to address a whole category of nodes at once ("pause all enemies",
  "save every checkpoint").

**When *not* to use:** raw signal *syntax* basics → `godot-gdscript`; scene structure
and instancing → `godot-nodes-scenes`. For cross-scene global events, emit from an
autoload (see `godot-nodes-scenes`).

## Core workflow

1. **Decide the direction.** A child/sub-scene should *emit* a signal upward; the parent
   *connects* to it. This keeps the child reusable and ignorant of who listens.
2. **Declare typed signals** on the emitter; `emit()` them when the event occurs.
3. **Connect with a Callable** (`sig.connect(_on_sig)`), optionally in the editor's Node
   dock. Use `CONNECT_ONE_SHOT` for fire-once, `bind()` to pass extra context.
4. **Use groups for broadcast**: add nodes to a named group, then iterate
   `get_tree().get_nodes_in_group(...)` or `call_group(...)`.
5. **Disconnect when needed** (e.g. before freeing a long-lived listener) and check
   `is_connected()` to avoid duplicate connections.

## Patterns

### 1. Emit upward, connect from the parent

```gdscript
# coin.gd (reusable pickup, knows nothing about the player or HUD)
extends Area2D
signal collected(value: int)

func _on_body_entered(body: Node) -> void:
    if body.is_in_group("player"):
        collected.emit(10)
        queue_free()
```

```gdscript
# level.gd (the parent wires the coin to game state)
func _ready() -> void:
    for coin in get_tree().get_nodes_in_group("coins"):
        coin.collected.connect(_on_coin_collected)

func _on_coin_collected(value: int) -> void:
    GameState.add_score(value)
```

The rest: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/HEAD/skills/godot/godot-signals-groups/SKILL.md
