godot-clear-children
CommunitySafely clear Godot child nodes.
AuthorGOODDAYDAY
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Safely clear Godot node hierarchies by removing all child nodes without causing runtime errors, memory leaks, or dangling references.
Core Features & Use Cases
- Demonstrates multiple correct patterns to clear all children in Godot: while get_child_count() > 0: get_child(0).queue_free() (loop-based cleanup); iterating over a duplicate of get_children() to avoid index shifts; and using the built-in clear_children() method when available (Godot 4.1+). Emphasizes best practices like using queue_free() (not free()), avoiding cleanup inside _process, and signaling before or after cleanup to maintain integrity.
- Real-world scenarios: cleaning up dynamically spawned nodes at scene transitions, after game over, or when resetting a level, ensuring memory is reclaimed and references are safely dropped.
- Edge-case handling: works with empty parents, nested scenes, and validates node integrity before performing cleanup.
Quick Start
Follow the examples to implement proper child removal in Godot projects using the recommended patterns.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: godot-clear-children Download link: https://github.com/GOODDAYDAY/Harness-Everything-Game-Framework/archive/main.zip#godot-clear-children Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.