godot-nodes-scenes
Что он делает
Этот скилл объясняет, как строить игры на Godot из узлов и сцен, базовых строительных блоков движка. Он нужен создателям игр, которым нужна аккуратная структура проекта.
Когда использовать
- ✓Когда вы проектируете сцены для персонажей, пуль, врагов или меню в Godot.
- ✓Когда вы хотите создавать копии сцены во время работы игры.
- ✓Когда появляются ошибки о том, что узел не найден или уже удален.
Ссылка на скилл
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-nodes-scenes/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Сделай мне многоразовую сцену врага в Godot, которую можно разместить много раз на уровне.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Скилл объясняет, как собрать небольшие сцены, превратить их в многоразовые шаблоны, добавлять их во время игры, безопасно обращаться к узлам, а также как регистрировать глобальные помощники, называемые автозагрузками.
Технический текст (оригинальный 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
- Обновлён
- 28.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
router
6.6kПомогает агенту выбрать нужный скилл для игровой разработки, определив движок и тип задачи.
ai-behavior-trees-utility-ai
6.6kПомогает агенту построить дерево поведения и систему утилитарного ИИ для врагов и персонажей игры, которые выбирают действия по приоритету и оценке.
audio-design
6.6kУчит агента сведению звука в играх: шины, громкость в децибелах, приглушение под диалоги, адаптивная музыка и вариации звуковых эффектов.
camera-systems
6.6kПомогает агенту создавать игровые камеры, которые плавно следуют за объектом, остаются в пределах уровня и вращаются или осматриваются в 3D.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.