godot-nodes-scenes
Agent skill fromgamedev-skills/awesome-gamedev-agent-skills
Structure a Godot 4.7 project with the scene tree and node composition: build reusable scenes, instance PackedScenes at runtime, navigate the tree safely, and register autoload singletons. Use when designing .tscn scenes, deciding how to split nodes, spawning instances with instantiate(), wiring autoloads, or fixing "node not found"/freed-node errors in a Godot project.
How to install godot-nodes-scenes
install godot-nodes-scenes
# 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-nodes-scenes/
# into
~/.claude/skills/godot-nodes-scenes/ (all projects)
.claude/skills/godot-nodes-scenes/ (one project)
1# Godot Nodes & Scenes (4.x)23Compose games from nodes and scenes, instance them at runtime, and access the tree4without crashing on freed or missing nodes. Targets **Godot 4.7**.56## When to use78- Use when structuring `.tscn` scenes, choosing how to break a feature into nodes,9 instancing a `PackedScene` (bullets, enemies, UI), or setting up autoload singletons.10- Use when debugging `get_node()` / `$Path` returning `null`, or "Attempt to call on a11 previously freed instance".1213**When _not_ to use:** GDScript language/syntax → `godot-gdscript`; signal-based14decoupling → `godot-signals-groups`; physics bodies/collisions → `godot-physics`.1516## Core workflow17181. **Model with composition.** A scene is a tree of nodes saved as `.tscn`. Build small,19 single-purpose scenes (Player, Bullet, Enemy) and compose larger scenes from them.20 Favor adding child nodes over deep inheritance.212. **Make a scene reusable** by giving its root a script and exposing `@export` config.22 Save it; it becomes a `PackedScene` you can instance many times.233. **Instance at runtime** with `preload`/`load` → `scene.instantiate()` →24 `add_child(instance)`. Set state needed by `_ready()` before adding. Convert world25 positions to the future parent's local space before adding, or set global position26 afterward only if `_ready()` does not need the final transform.274. **Access nodes safely.** Use `@onready var x = $Path` for fixed children; use unique28…
Excerpt shown under the repository's Apache-2.0 license.
