tdryhf/fantastic-enigm/godot-debugging
Claude Code and agent skill by tdryhf/fantastic-enigm
- community
Checking that the SKILL.md file is still in the repository.
Use when debugging Godot projects — remote debugger, print techniques, signal tracing, common error patterns and fixes
Install
npx vskill@latest install tdryhf/fantastic-enigm/godot-debuggingSKILL.md
The same SKILL.md was published earlier as jame581/godotprompter/godot-debugging.
Godot Debugging
This skill covers systematic debugging for Godot 4.3+ projects in both GDScript and C#. It covers print techniques, breakpoints, signal tracing, the built-in profiler, scene tree inspection, common error patterns, and a step-by-step debugging checklist.
Related skills: godot-optimization for performance profiling, godot-testing for regression tests after fixes, csharp-signals for C# signal debugging patterns.
1. Print Debugging
GDScript
Godot provides several print functions with different purposes. Choose based on the severity and context of what you are logging.
Formatted output patterns:
When to use each function:
| Function | Visible in Release | Stack Trace | Use For | |
|---|---|---|---|---|
print() | Yes (if not stripped) | No | General value inspection | |
print_rich() | Yes | No | Categorised, colour-coded logs | |
push_error() | Yes | Yes | Invalid state, programmer errors | |
push_warning() | Yes | Yes | Recoverable problems | |
print_debug() | No | No | Verbose frame-level output | |
printerr() | Yes | No | External terminal / CI output |
C\#
2. Breakpoints and the Remote Debugger
Setting Breakpoints
- Click the gutter (left of line numbers) in the Script editor to toggle a breakpoint. A red dot appears.
- Use
F9to toggle a breakpoint on the current line. - Use
breakpointas a statement in GDScript to trigger a programmatic breakpoint:
- In C#, use
System.Diagnostics.Debugger.Break()or attach a .NET debugger (e.g. JetBrains Rider or VS Code with the Godot extension).
Using the Built-in Debugger Panel
When execution pauses at a breakpoint, the Debugger panel (bottom of the editor) provides:
- Stack Frames — the full call stack; click a frame to inspect its local variables.
- Locals / Members / Globals — inspect and modify variable values live.
- Step Into (F11) / Step Over (F10) / Step Out (Shift+F11) — navigate execution line by line.
- Continue (F5) — resume execution until the next breakpoint.
Remote Scene Inspector
While a running game is paused or mid-session:
- Open Debugger > Remote tab in the editor.
- Click Remote in the Scene panel (top-left toggle next to "Scene") to switch the scene tree to the live view.
- Click any live node to inspect its current properties in the Inspector.
- Property changes made here are applied immediately for testing.
Monitors Tab
Debugger > Monitors displays real-time engine metrics:
- FPS / Process time / Physics time — spot performance regressions.
- Video RAM / Object count / Node count — track memory growth.
- Physics 2D/3D collision pairs — identify expensive physics scenes.
- Audio latency — catch audio callback overruns.
Click any monitor name to open its graph. Use the Add button to build custom monitor dashboards.
3. Signal Debugging
Inspect at runtime via node.get_signal_connection_list("signal_name") (returns Array of Dictionary with callable, flags, signal). The most common signal bugs: connecting twice (handler fires twice), forgetting to disconnect on free (warnings + dangling refs), wrong handler signature (silent miss).
See references/signal-tracing.md for the full GDScript and C# inspection helpers and the common-signal-issues catalog (double connect, deferred-free races, lambda capture lifecycle, signal-vs-Callable choice).
4. Common Error Patterns
| Error Message | Cause | Fix | |
|---|---|---|---|
Node not found: "Player" (relative to "...") | Wrong node path, node renamed, or accessed before it is added to the tree | Use $NodeName only in/after _ready(). Verify path with print(get_node_or_null("Player")). Use @onready. | |
Attempt to call function on a null instance | Node was freed, export not assigned, or get_node() returned null | Guard with is_instance_valid(node). Check exports in Inspector. Prefer @onready var _node := $Node. | |
Can't change this state while flushing queries | Modifying physics state (e.g. disabling a CollisionShape) inside a physics callback such as body_entered | Defer the change: collision_shape.set_deferred("disabled", true). | |
Invalid call. Nonexistent function 'X' in base 'Y' | Calling a method that does not exist on that type, or accessing a node as the wrong type | Check class_name, cast with as, or verify the script is attached. Use has_method("X") to guard. | |
Cyclic reference (on JSON.stringify or resource save) | A Resource or Dictionary references itself, directly or indirectly | Break the cycle. Use node references instead of resource references where possible, or mark sub-resources as local only. | |
Cannot access member without instance | Calling an instance method as if it were static, or accessing self in a @static function | Move the call to an instance context or refactor to a proper static helper that takes data as arguments. | |
Stack overflow / Maximum recursion depth reached | Infinite recursion — often a signal that triggers itself, or a setter that sets itself | Add a guard variable (_updating := true) in setters. Trace the call stack in the Debugger. | |
Already connected | Calling connect() a second time on the same signal/callable pair without CONNECT_ONE_SHOT | Check is_connected() before connecting, or disconnect first, or use CONNECT_REFERENCE_COUNTED. | |
Index out of bounds (index X out of size Y) | Accessing an Array or PackedArray beyond its length | Validate index before access: if index < array.size(). Use array.get(index) where available. | |
Condition "p_mbuf_current..." is true / audio underrun | Audio callback missed its deadline; processing too much on the audio thread | Reduce audio bus effects, lower polyphony, or increase audio buffer size in Project Settings. |
5. Performance Debugging
The Profiler (Debugger → Profiler) shows per-function self-time and call counts. The Monitors tab tracks frame time, FPS, draw-call count, physics tick budget, memory. Open both during the most demanding gameplay scenario; sort the Profiler by Self time to find culprits. For draw-call bottlenecks, watch Visible/Per frame in the Monitors tab.
See references/performance-debugging.md for Profiler workflow, Monitors tab usage, draw-call bottleneck identification, physics-tick monitoring patterns. See also godot-optimization for fixes once a bottleneck is identified.
6. Scene Tree Debugging
print_tree_pretty() dumps the current scene tree to stdout — the fastest way to confirm a node lives where you think. The Remote tab in the editor shows the live scene tree while the game runs. For @tool nodes, implement _get_configuration_warnings() to surface configuration errors in the editor SceneTree dock.
See references/scene-tree-debugging.md for full examples (print_tree_pretty patterns, node-group debug helpers, _get_configuration_warnings GDScript + C#).
7. Systematic Debugging Method
When prints, breakpoints, and remote inspection don't immediately reveal the bug, fall back to a deliberate process: Reproduce → Isolate → Hypothesis → Trace → Fix → Verify → Add a Test. Each step gates the next; skipping ahead wastes time.
See references/systematic-method.md for the full 7-step method with concrete techniques per step (binary search, minimal repro, regression-test patterns).
8. Implementation Checklist
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tdryhf/fantastic-enigm/godot-debugging)