godot-nodes-scenes-sh-fdxixs
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "godot-nodes-scenes-sh-fdxixs" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-241e9a7d6081e33fa7918088567edfa737ca7a99c03796745469b4390242ae0e. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/godot-nodes-scenes-sh-fdxixs before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Specialized skill for Godot nodes and scenes, helping an AI agent efficiently complete tasks and workflows related to Godot nodes and scenes.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Compose games from nodes and scenes, instance them at runtime, and access the tree without crashing on freed or missing nodes. Targets **Godot 4.3+**.
- Audience
- Use when structuring `.tscn` scenes, choosing how to break a feature into nodes, instancing a `PackedScene` (bullets, enemies, UI), or setting up autoload singletons. Use when debugging `get_node()` / `$Path` returning `null`, 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`.
- Testing
- Not tested
Browse files
Frontmatter
name: Godotnodesscenes
slug: godot-nodes-scenes
version: 1.0.0
displayName: Godotnodesscenes
description: >
Godotnodesscenes专用技能,帮助AI Agent高效完成相关任务。
Godotnodesscenes专用技能,帮助AI Agent高效完成相关任务。
summary: "Godotnodesscenes专用技能,帮助AI Agent高效完成相关任务。"
license: Apache-2.0
category: 游戏开发
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"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.3+.
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().
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_child()is fine, but_ready()on the child only runs after it enters the tree — don't expect its@onreadyvars before that. - Autoload order matters: autoloads are added before the main scene, in list order. An autoload can't depend on the main scene existing yet.
instance()was renamed toinstantiate()in Godot 4.preloadruns at parse time (path must be constant);loadruns at runtime (path can be a variable).change_scene_to_file()is deferred, not immediate — Godot swaps and frees the old scene at the end of the current frame. Any code after the call still runs against the old tree, andget_tree().current_sceneisn't the new scene until next frame. Don't read the new scene's nodes on the same line; do it from the new scene's_ready().
References
- For scene inheritance,
owner/ownership when saving scenes from code, groups vs unique names, and node-path edge cases, readreferences/tree-and-instancing.md.
Related skills
godot-gdscript— language, lifecycle, and@onready.godot-signals-groups— decouple instanced scenes from their spawner.godot-resources— share data between instances without duplicating it.save-systems— persist scene/game state across runs.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Godot 游戏引擎开发者提供专业的节点与场景管理指导
- 涵盖从基础工作流到高级模式的全套解决方案
- 有效解决 Godot 开发中的常见痛点问题
Areas to improve
-
description 写错位置 Reported severity: Minor
顶层 description 字段为空,实际描述内容位于 skill_body 内部
Recommendation: 将触发描述移至顶层 description 字段,确保用户能快速识别技能用途
Highlights
- skill_body 中 'When to use' 章节提供了清晰的触发场景说明
Highlights
- 结构完整,包含工作流、模式、陷阱等多个维度
- 提供丰富的代码示例,便于理解与实践
- frontmatter 完整,符合规范要求
Highlights
- 基于 Godot 官方 API,工具来源明确可靠
- 全面覆盖异常场景并提供安全处理建议
- 对不可逆操作有明确的安全机制指导
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.