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 scenes, choosing how to break a feature into nodes, instancing a (bullets, enemies, UI), or setting up autoload singletons. - Use when debugging / returning , or "Attempt to call on a previously freed instance". When not to use: GDScript language/syntax → ; signal-based decoupling → ; physics bodies/collisions → . Core workflow 1. Model with composition. A scene is a tree of nodes saved…

, line)\n key = \"\"\n value = \"\"\n if m and not line.startswith(('\"', \" \", \"\\t\")):\n key = m.group(1).strip()\n value = m.group(2).strip()\n setting = f\"{section}/{key}\" if section else key\n string_value = re.fullmatch(r'\"((?:[^\"\\\\]|\\\\.)*)\"', value) if key else None\n if section == \"application\" and re.fullmatch(r\"run/main_scene(\\.[\\w.]+)?\", key):\n scene = unescape(string_value.group(1)) if string_value else \"\"\n if key == \"run/main_scene\" and scene:\n main_scene_seen = True\n if scene:\n self._check_plain_path(rel, lineno, scene, \"\", \"error\", \"main-scene-missing\",\n f\"application/{key}\")\n continue\n if section == \"autoload\" and key:\n if string_value:\n target = unescape(string_value.group(1)).lstrip(\"*\")\n self._check_plain_path(rel, lineno, target, \"\", \"error\", \"autoload-missing\",\n f\"autoload {key}\")\n continue\n if string_value and string_value.group(1).startswith(\"uid://\"):\n # A uid is only checked when it is the whole value of a setting.\n self._check_plain_path(rel, lineno, unescape(string_value.group(1)), \"\", \"warning\",\n \"project-path-missing\", f\"setting {setting}\")\n continue\n for sm in PROJECT_STRING_RE.finditer(line):\n raw = unescape(sm.group(1))\n if raw.startswith(\"res://\"):\n self._check_plain_path(rel, lineno, raw, \"\", \"warning\", \"project-path-missing\",\n f\"setting {setting}\", case_severity=\"warning\")\n if not main_scene_seen:\n self.add(\"warning\", \"main-scene-not-set\", rel, None,\n \"application/run/main_scene is not set; the exported game has no scene to start.\",\n \"Set it in Project Settings > Application > Run > Main Scene \"\n '(run/main_scene=\"res://main.tscn\" under [application]).')\n\n def check_script(self, rel: str) -> None:\n self.files_checked += 1\n text = self.load(rel)\n base_dir = posixpath.dirname(rel)\n if rel in self.unreadable:\n self.add_unreadable(rel)\n return\n for lineno, line in enumerate(text.split(\"\\n\"), start=1):\n if \"://\" not in line:\n continue\n code = strip_comment(line)\n m = EXTENDS_RE.match(code)\n if m:\n self._check_plain_path(rel, lineno, m.group(2), base_dir, \"warning\", \"script-path-missing\",\n \"extends\")\n for m in SCRIPT_CALL_RE.finditer(code):\n self._check_plain_path(rel, lineno, m.group(3), base_dir, \"warning\", \"script-path-missing\",\n f\"{m.group(1)}()\")\n\n def read_project_settings(self) -> None:\n text = self.load(\"project.godot\")\n if re.search(r\"^config/use_hidden_project_data_directory\\s*=\\s*false\\s*$\", text, re.M):\n self.data_dir = \"godot\"\n\n def run(self) -> None:\n self.read_project_settings()\n self.scan()\n self.index_uids()\n self.check_project_file()\n for rel in self.files:\n suffix = Path(rel).suffix.lower()\n if suffix in TEXT_RESOURCE_EXTS:\n self.check_text_resource(rel)\n elif suffix == \".gd\":\n self.check_script(rel)\n elif suffix in (\".import\", \".uid\"):\n self.files_checked += 1\n\n\n# ----------------------------------------------------------------------- CLI\n\n\ndef build_parser() -> argparse.ArgumentParser:\n parser = argparse.ArgumentParser(\n prog=\"check_godot_project.py\",\n description=(\n \"Read-only check of a Godot 4.x project for broken references: missing or \"\n \"wrong-case res:// paths, unknown or duplicate uids, undeclared ExtResource/SubResource \"\n \"ids, broken scene trees and signal connections, project.godot main scene and \"\n \"autoloads, and literal preload()/load() paths in .gd scripts.\"\n ),\n epilog=(\n \"example:\\n\"\n \" python scripts/check_godot_project.py path/to/my_game\\n\"\n \" python scripts/check_godot_project.py . --json --max-issues 20\\n\\n\"\n \"exit codes: 0 no errors, 1 errors found (or warnings with --strict), \"\n \"2 usage problem or no project.godot\"\n ),\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n parser.add_argument(\"project_dir\", nargs=\"?\", default=\".\", metavar=\"PROJECT_DIR\",\n help=\"folder that contains project.godot (default: current folder)\")\n parser.add_argument(\"--json\", action=\"store_true\", help=\"print one JSON object instead of text\")\n parser.add_argument(\"--strict\", action=\"store_true\", help=\"exit 1 when there are warnings too\")\n parser.add_argument(\"--max-issues\", type=int, default=50, metavar=\"N\",\n help=\"print at most N issues, errors first (default: 50; 0 = no limit)\")\n return parser\n\n\ndef main(argv: list[str] | None = None) -> int:\n # A console or pipe that cannot encode a file name (Windows code pages) must not crash the report.\n for stream in (sys.stdout, sys.stderr):\n if hasattr(stream, \"reconfigure\"):\n stream.reconfigure(errors=\"backslashreplace\")\n parser = build_parser()\n args = parser.parse_args(argv)\n if args.max_issues \u003c 0:\n parser.error(\"--max-issues must be 0 or more\")\n root = Path(args.project_dir).expanduser()\n if not root.is_dir():\n print(f\"error: {args.project_dir} is not a folder\", file=sys.stderr)\n return 2\n if not (root / \"project.godot\").is_file():\n print(f\"error: {args.project_dir} is not a Godot project (no project.godot found there)\",\n file=sys.stderr)\n return 2\n root = root.resolve()\n project = Project(root)\n project.run()\n\n def sort_key(issue: Issue) -> tuple:\n return (issue.file, issue.line or 0, issue.code, issue.message)\n\n errors = sorted((i for i in project.issues if i.severity == \"error\"), key=sort_key)\n warnings = sorted((i for i in project.issues if i.severity == \"warning\"), key=sort_key)\n ordered = errors + warnings\n shown = ordered[: args.max_issues] if args.max_issues else ordered\n truncated = len(ordered) > len(shown)\n\n if args.json:\n payload = {\n \"tool\": TOOL,\n \"schema\": SCHEMA,\n \"root\": root.as_posix(),\n \"files_checked\": project.files_checked,\n \"error_count\": len(errors),\n \"warning_count\": len(warnings),\n \"errors\": [i.as_dict() for i in shown if i.severity == \"error\"],\n \"warnings\": [i.as_dict() for i in shown if i.severity == \"warning\"],\n \"truncated\": truncated,\n }\n print(json.dumps(payload, indent=2))\n else:\n for issue in shown:\n where = f\"{issue.file}:{issue.line}\" if issue.line else issue.file\n print(f\"{issue.severity.upper()} {where}: {issue.message}\")\n print(f\" fix: {issue.fix}\")\n if truncated:\n print(f\"... and {len(ordered) - len(shown)} more\")\n print(f\"Summary: {len(errors)} errors, {len(warnings)} warnings in {project.files_checked} files checked\")\n\n if errors or (args.strict and warnings):\n return 1\n return 0\n\n\nif __name__ == \"__main__\":\n sys.exit(main())\n","content_type":"text/x-python; charset=utf-8","language":"python","size":54905,"content_sha256":"779b2130ce00c9566b6a1972dc49916bc270922e1df7fb705a93cc0d5053ef85"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Godot Nodes & Scenes (4.x)","type":"text"}]},{"type":"paragraph","content":[{"text":"Compose games from nodes and scenes, instance them at runtime, and access the tree without crashing on freed or missing nodes. Targets ","type":"text"},{"text":"Godot 4.7","type":"text","marks":[{"type":"strong"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to use","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use when structuring ","type":"text"},{"text":".tscn","type":"text","marks":[{"type":"code_inline"}]},{"text":" scenes, choosing how to break a feature into nodes, instancing a ","type":"text"},{"text":"PackedScene","type":"text","marks":[{"type":"code_inline"}]},{"text":" (bullets, enemies, UI), or setting up autoload singletons.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use when debugging ","type":"text"},{"text":"get_node()","type":"text","marks":[{"type":"code_inline"}]},{"text":" / ","type":"text"},{"text":"$Path","type":"text","marks":[{"type":"code_inline"}]},{"text":" returning ","type":"text"},{"text":"null","type":"text","marks":[{"type":"code_inline"}]},{"text":", or \"Attempt to call on a previously freed instance\".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"When ","type":"text","marks":[{"type":"strong"}]},{"text":"not","type":"text","marks":[{"type":"strong"},{"type":"em"}]},{"text":" to use:","type":"text","marks":[{"type":"strong"}]},{"text":" GDScript language/syntax → ","type":"text"},{"text":"godot-gdscript","type":"text","marks":[{"type":"code_inline"}]},{"text":"; signal-based decoupling → ","type":"text"},{"text":"godot-signals-groups","type":"text","marks":[{"type":"code_inline"}]},{"text":"; physics bodies/collisions → ","type":"text"},{"text":"godot-physics","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core workflow","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Model with composition.","type":"text","marks":[{"type":"strong"}]},{"text":" A scene is a tree of nodes saved as ","type":"text"},{"text":".tscn","type":"text","marks":[{"type":"code_inline"}]},{"text":". Build small, single-purpose scenes (Player, Bullet, Enemy) and compose larger scenes from them. Favor adding child nodes over deep inheritance.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Make a scene reusable","type":"text","marks":[{"type":"strong"}]},{"text":" by giving its root a script and exposing ","type":"text"},{"text":"@export","type":"text","marks":[{"type":"code_inline"}]},{"text":" config. Save it; it becomes a ","type":"text"},{"text":"PackedScene","type":"text","marks":[{"type":"code_inline"}]},{"text":" you can instance many times.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Instance at runtime","type":"text","marks":[{"type":"strong"}]},{"text":" with ","type":"text"},{"text":"preload","type":"text","marks":[{"type":"code_inline"}]},{"text":"/","type":"text"},{"text":"load","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"scene.instantiate()","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"add_child(instance)","type":"text","marks":[{"type":"code_inline"}]},{"text":". Set position/state ","type":"text"},{"text":"after","type":"text","marks":[{"type":"em"}]},{"text":" adding (or before, both work).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Access nodes safely.","type":"text","marks":[{"type":"strong"}]},{"text":" Use ","type":"text"},{"text":"@onready var x = $Path","type":"text","marks":[{"type":"code_inline"}]},{"text":" for fixed children; use unique names (","type":"text"},{"text":"%Name","type":"text","marks":[{"type":"code_inline"}]},{"text":") for nodes deep in the tree; never assume a node still exists.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use autoloads for global state/services","type":"text","marks":[{"type":"strong"}]},{"text":" (game state, audio, scene switching) — registered in Project Settings > Globals (Autoload), accessible by name everywhere.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Free nodes with ","type":"text","marks":[{"type":"strong"}]},{"text":"queue_free()","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" and guard later access with ","type":"text"},{"text":"is_instance_valid()","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check references before you finish.","type":"text","marks":[{"type":"strong"}]},{"text":" After creating, moving or renaming scenes, resources or scripts, run ","type":"text"},{"text":"python scripts/check_godot_project.py \u003cproject-dir>","type":"text","marks":[{"type":"code_inline"}]},{"text":" (no Godot install needed; ","type":"text"},{"text":"--json","type":"text","marks":[{"type":"code_inline"}]},{"text":" for machine-readable output). Fix every ","type":"text"},{"text":"ERROR","type":"text","marks":[{"type":"code_inline"}]},{"text":" (missing or wrong-case ","type":"text"},{"text":"res://","type":"text","marks":[{"type":"code_inline"}]},{"text":" paths, undeclared ","type":"text"},{"text":"ExtResource","type":"text","marks":[{"type":"code_inline"}]},{"text":"/","type":"text"},{"text":"SubResource","type":"text","marks":[{"type":"code_inline"}]},{"text":" ids, bad ","type":"text"},{"text":"parent=","type":"text","marks":[{"type":"code_inline"}]},{"text":" paths, missing main scene or autoload) and re-run until it exits 0. Warnings such as a stale ","type":"text"},{"text":"path=","type":"text","marks":[{"type":"code_inline"}]},{"text":" 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.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Patterns","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. Instance a scene at runtime","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"gdscript"},"content":[{"text":"extends Node2D\n\nconst BULLET := preload(\"res://bullet.tscn\") # preload: loaded at compile time\n\nfunc shoot(at: Vector2, dir: Vector2) -> void:\n var bullet := BULLET.instantiate() # create an instance of the scene\n bullet.global_position = at\n bullet.direction = dir # set exported/public state\n add_child(bullet) # now it's in the tree and runs","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. Safe node access: $, get_node_or_null, and unique names","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"gdscript"},"content":[{"text":"@onready var label: Label = $UI/Label # $ is sugar for get_node(\"UI/Label\")\n@onready var health_bar: ProgressBar = %HealthBar # % = scene-unique name (rename-proof)\n\nfunc update() -> void:\n var optional := get_node_or_null(\"Maybe/Missing\") # returns null instead of erroring\n if optional:\n optional.queue_free()","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. An autoload singleton (global game state)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"gdscript"},"content":[{"text":"# game_state.gd — add in Project Settings > Globals > Autoload as \"GameState\".\nextends Node\n\nvar score := 0\nsignal score_changed(value: int)\n\nfunc add_score(points: int) -> void:\n score += points\n score_changed.emit(score) # any scene can: GameState.score_changed.connect(...)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. Change the running scene","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"gdscript"},"content":[{"text":"func go_to_level_2() -> void:\n # Swaps the current scene for another. Frees the old scene tree.\n get_tree().change_scene_to_file(\"res://levels/level_2.tscn\")\n # Or, with a preloaded PackedScene:\n # get_tree().change_scene_to_packed(LEVEL_2)","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Pitfalls","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"$Path","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" / ","type":"text","marks":[{"type":"strong"}]},{"text":"get_node()","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" return ","type":"text","marks":[{"type":"strong"}]},{"text":"null","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" or error","type":"text","marks":[{"type":"strong"}]},{"text":" when the path is wrong or the node isn't in the tree yet. Use ","type":"text"},{"text":"@onready","type":"text","marks":[{"type":"code_inline"}]},{"text":", verify the path matches the scene, or use ","type":"text"},{"text":"get_node_or_null()","type":"text","marks":[{"type":"code_inline"}]},{"text":" for optional nodes.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Renaming a node breaks ","type":"text","marks":[{"type":"strong"}]},{"text":"$Path","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":".","type":"text","marks":[{"type":"strong"}]},{"text":" Use ","type":"text"},{"text":"unique names","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"%Name","type":"text","marks":[{"type":"code_inline"}]},{"text":", set via right-click","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Access as Unique Name) so deep references survive renames and reparenting.","type":"text"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"free()","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" mid-frame can crash","type":"text","marks":[{"type":"strong"}]},{"text":" other code still using the node. Prefer ","type":"text"},{"text":"queue_free()","type":"text","marks":[{"type":"code_inline"}]},{"text":" (deletes at end of frame) and check ","type":"text"},{"text":"is_instance_valid(node)","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Setting child state before ","type":"text","marks":[{"type":"strong"}]},{"text":"add_child()","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" is fine, but ","type":"text"},{"text":"_ready()","type":"text","marks":[{"type":"code_inline"}]},{"text":" on the child only runs ","type":"text"},{"text":"after","type":"text","marks":[{"type":"em"}]},{"text":" it enters the tree — don't expect its ","type":"text"},{"text":"@onready","type":"text","marks":[{"type":"code_inline"}]},{"text":" vars before that.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Autoload order matters","type":"text","marks":[{"type":"strong"}]},{"text":": autoloads are added before the main scene, in list order. An autoload can't depend on the main scene existing yet.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"instance()","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" was renamed","type":"text","marks":[{"type":"strong"}]},{"text":" to ","type":"text"},{"text":"instantiate()","type":"text","marks":[{"type":"code_inline"}]},{"text":" in Godot 4. ","type":"text"},{"text":"preload","type":"text","marks":[{"type":"code_inline"}]},{"text":" runs at parse time (path must be constant); ","type":"text"},{"text":"load","type":"text","marks":[{"type":"code_inline"}]},{"text":" runs at runtime (path can be a variable).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"change_scene_to_file()","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" is deferred, and the old scene leaves the tree at once.","type":"text","marks":[{"type":"strong"}]},{"text":" The outgoing scene is removed from the tree immediately (its ","type":"text"},{"text":"get_tree()","type":"text","marks":[{"type":"code_inline"}]},{"text":" now returns ","type":"text"},{"text":"null","type":"text","marks":[{"type":"code_inline"}]},{"text":", and ","type":"text"},{"text":"get_tree().current_scene","type":"text","marks":[{"type":"code_inline"}]},{"text":" is ","type":"text"},{"text":"null","type":"text","marks":[{"type":"code_inline"}]},{"text":"), then at the end of the frame it is freed and the new scene is added. Code after the call must not touch ","type":"text"},{"text":"get_tree()","type":"text","marks":[{"type":"code_inline"}]},{"text":" from the old scene. To act on the new scene, do it from the new scene's ","type":"text"},{"text":"_ready()","type":"text","marks":[{"type":"code_inline"}]},{"text":", or from an autoload with ","type":"text"},{"text":"await get_tree().scene_changed","type":"text","marks":[{"type":"code_inline"}]},{"text":" (Godot 4.5+). ","type":"text"},{"text":"change_scene_to_node(node)","type":"text","marks":[{"type":"code_inline"}]},{"text":" (4.6+) swaps in a node you have already instanced and configured.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"References","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For scene inheritance, ","type":"text"},{"text":"owner","type":"text","marks":[{"type":"code_inline"}]},{"text":"/ownership when saving scenes from code, groups vs unique names, and node-path edge cases, read ","type":"text"},{"text":"references/tree-and-instancing.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"scripts/check_godot_project.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" — read-only reference checker for a Godot 4.x project; ","type":"text"},{"text":"--help","type":"text","marks":[{"type":"code_inline"}]},{"text":" lists every check and the exit codes.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Related skills","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"godot-gdscript","type":"text","marks":[{"type":"code_inline"}]},{"text":" — language, lifecycle, and ","type":"text"},{"text":"@onready","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"godot-signals-groups","type":"text","marks":[{"type":"code_inline"}]},{"text":" — decouple instanced scenes from their spawner.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"godot-resources","type":"text","marks":[{"type":"code_inline"}]},{"text":" — share data between instances without duplicating it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"save-systems","type":"text","marks":[{"type":"code_inline"}]},{"text":" — persist scene/game state across runs.","type":"text"}]}]}]}]},"metadata":{"date":"2026-11-02","name":"godot-nodes-scenes","author":"@skillopedia","source":{"stars":6571,"repo_name":"awesome-gamedev-agent-skills","origin_url":"https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/HEAD/skills/godot/godot-nodes-scenes/SKILL.md","repo_owner":"gamedev-skills","body_sha256":"fc0096a774a8581678180ed0e71039eea52533411b4b45dee708ebad10c920af","cluster_key":"d9042da132a98e6021d503e31fd8d54a77fe9c12dcd36d0e76eafa5ffa7a247f","clean_bundle":{"format":"clean-skill-bundle-v1","source":"gamedev-skills/awesome-gamedev-agent-skills/skills/godot/godot-nodes-scenes/SKILL.md","text_bytes":57915,"source_commit":"19d93f97c9c1ea0f8b306e77aa81e0d3e352d3e9","skills_sh_rank":2967,"attachment_count":2,"text_attachments":2,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"skills/godot/godot-nodes-scenes/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"games-interactive","category_label":"Games"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"games-interactive","import_tag":"skills-sh-top20k-2026-11","description":"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.\n"}},"renderedAt":1793666465319}

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 scenes, choosing how to break a feature into nodes, instancing a (bullets, enemies, UI), or setting up autoload singletons. - Use when debugging / returning , or "Attempt to call on a previously freed instance". When not to use: GDScript language/syntax → ; signal-based decoupling → ; physics bodies/collisions → . Core workflow 1. Model with composition. A scene is a tree of nodes saved…