godot-nodes-scenes
하는 일
이 스킬은 엔진의 기본 구성 요소인 노드와 씬으로 Godot 게임을 만드는 방법을 설명합니다. 깔끔한 프로젝트 구조가 필요한 게임 제작자를 위한 스킬입니다.
사용하는 경우
- ✓Godot에서 캐릭터, 총알, 적, 메뉴를 위한 씬을 설계할 때.
- ✓게임이 실행되는 동안 씬의 복사본을 만들고 싶을 때.
- ✓노드를 찾을 수 없다거나 이미 삭제된 노드에 대한 오류가 보일 때.
스킬 링크
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-nodes-scenes/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“레벨에 여러 번 배치할 수 있는 재사용 가능한 적 씬을 Godot에서 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
작은 씬을 만드는 방법, 이를 재사용 가능한 템플릿으로 만드는 방법, 게임 실행 중에 추가하는 방법, 노드에 안전하게 접근하는 방법, 그리고 오토로드(autoload)라고 부르는 전역 도우미를 등록하는 방법을 설명합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Godot Nodes & Scenes (4.x)
Compose games from nodes and scenes, instance them at runtime, and access the tree without crashing on freed or missing nodes. Targets Godot 4.7.
When to use
- Use when structuring
.tscnscenes, choosing how to break a feature into nodes, instancing aPackedScene(bullets, enemies, UI), or setting up autoload singletons. - Use when debugging
get_node()/$Pathreturningnull, or "Attempt to call on a previously freed instance".
When not to use: GDScript language/syntax → godot-gdscript; signal-based
decoupling → godot-signals-groups; physics bodies/collisions → godot-physics.
Core workflow
- Model with composition. A scene is a tree of nodes saved as
.tscn. Build small, single-purpose scenes (Player, Bullet, Enemy) and compose larger scenes from them. Favor adding child nodes over deep inheritance. - Make a scene reusable by giving its root a script and exposing
@exportconfig. Save it; it becomes aPackedSceneyou can instance many times. - Instance at runtime with
preload/load→scene.instantiate()→add_child(instance). Set position/state after adding (or before, both work). - Access nodes safely. Use
@onready var x = $Pathfor fixed children; use unique names (%Name) for nodes deep in the tree; never assume a node still exists. - Use autoloads for global state/services (game state, audio, scene switching) — registered in Project Settings > Globals (Autoload), accessible by name everywhere.
- Free nodes with
queue_free()and guard later access withis_instance_valid(). - Check references before you finish. After creating, moving or renaming scenes,
resources or scripts, run
python scripts/check_godot_project.py <project-dir>(no Godot install needed;--jsonfor machine-readable output). Fix everyERROR(missing or wrong-caseres://paths, undeclaredExtResource/SubResourceids, badparent=paths, missing main scene or autoload) and re-run until it exits 0. Warnings such as a stalepath=that Godot still finds by uid are safe but worth fixing. Run the script path relative to this skill directory, or resolve the installed skill path first. It needs Python 3.10+ and nothing else, and it does not replace opening the project in Godot.
Patterns
1. Instance a scene at runtime
extends Node2D
const BULLET := preload("res://bullet.tscn") # preload: loaded at compile time
func shoot(at: Vector2, dir: Vector2) -> void:
var bullet := BULLET.instantiate() # create an instance of the scene
bullet.global_position = at
bullet.direction = dir # set exported/public state
add_child(bullet) # now it's in the tree and runs
2. Safe node access: $, get_node_or_null, and unique names
@onready var label: Label = $UI/Label # $ is sugar for get_node("UI/Label")
@onready var health_bar: ProgressBar = %HealthBar # % = scene-unique name (rename-proof)
func update() -> void:
var optional := get_node_or_null("Maybe/Missing") # returns null instead of erroring
if optional:
optional.queue_free()
3. An autoload singleton (global game state)
# game_state.gd — add in Project Settings > Globals > Autoload as "GameState".
extends Node
var score := 0
signal score_changed(value: int)
func add_score(points: int) -> void:
score += points
score_changed.emit(score) # any scene can: GameState.score_changed.connect(...)
4. Change the running scene
func go_to_level_2() -> void:
# Swaps the current scene for another. Frees the old scene tree.
get_tree().change_scene_to_file("res://levels/level_2.tscn")
# Or, with a preloaded PackedScene:
# get_tree().change_scene_to_packed(LEVEL_2)
Pitfalls
$Path/get_node()returnnullor error when the path is wrong or the node isn't in the tree yet. Use@onready, verify the path matches the scene, or useget_node_or_null()for optional nodes.- Renaming a node breaks
$Path. Use unique names (%Name, set via right-clickAccess as Unique Name) so deep references survive renames and reparenting.
free()mid-frame can crash other code still using the node. Preferqueue_free()(deletes at end of frame) and checkis_instance_valid(node).- **Setting child state before `add
자주 묻는 질문
Godot에서 씬이란 무엇인가요?
씬은 저장된 노드 트리로, 재사용하거나 다른 씬 안에 배치할 수 있습니다.
오토로드란 무엇인가요?
오토로드는 게임 전체에서 계속 로드된 상태로 유지되는 전역 객체입니다. 예를 들어 공유 설정을 담는 객체가 있습니다.
물리도 다루나요?
깊게 다루지는 않습니다. 물리 바디와 충돌은 별도의 Godot 스킬에서 다룹니다.
상세 정보
작성자의 원본 설명
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.
인기도
- GitHub 스타
- 6.6k
- 순위
- #13825
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 10. 28.
댓글
- …
이 저장소의 다른 스킬
router
6.6k에이전트가 엔진과 작업 종류를 파악해, 요청에 맞는 게임 개발 스킬을 골라 주도록 돕습니다.
ai-behavior-trees-utility-ai
6.6k에이전트가 적이나 캐릭터가 우선순위와 점수로 행동을 고르는 행동 트리와 유틸리티 AI 시스템을 만들도록 돕습니다.
audio-design
6.6k에이전트에게 게임 오디오 믹싱을 가르칩니다. 버스, 데시벨 음량, 대사 아래에서의 덕킹, 적응형 음악, 효과음 변주를 다룹니다.
camera-systems
6.6k에이전트가 부드럽게 따라가고, 레벨 안에 머물고, 3D에서 회전하거나 둘러볼 수 있는 게임 카메라를 만들도록 돕습니다.