Index of every page on this site: llms.txt
All skills
jame581 avatar

/godot-debugging

@426e8ab
by Jan Mesarčjame581/godotprompter979 stars
63
Run it yourself

Use when debugging Godot projects — remote debugger, print techniques, signal tracing, common error patterns and fixes

Use this Skill: https://skilld.dev/gh/jame581/godotprompter/godot-debugging

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesscene-tree-debugging.md

≈819 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Scene Tree Debugging

Reference for skills/godot-debugging/SKILL.md — print_tree_pretty(), remote scene tree, node groups for debugging, _get_configuration_warnings() for @tool scripts.

← Back to SKILL.md


6. Scene Tree Debugging

print_tree_pretty()

# Print the full subtree of a node in a readable format
func _ready() -> void:
    print_tree_pretty()
    # Output example:
    # ┖╴Player
    #    ┠╴CollisionShape3D
    #    ┠╴MeshInstance3D
    #    ┖╴Camera3D

# Print the entire scene tree from root
func _ready() -> void:
    get_tree().root.print_tree_pretty()
// Print the full subtree of a node in a readable format
public override void _Ready()
{
    PrintTreePretty();

    // Print the entire scene tree from root
    GetTree().Root.PrintTreePretty();
}

Remote Scene Tree in the Editor

  1. Run the game.
  2. In the Scene panel, click Remote (top-left toggle).
  3. The live scene tree appears — nodes are shown with their current state.
  4. Click any node to open it in the Inspector and edit properties in real time.
  5. Use Debugger > Breakpoints to pause and then inspect mid-frame state.

Node Groups for Debugging

# Tag nodes at runtime for batch inspection
func _ready() -> void:
    add_to_group("debug_enemies")

# Retrieve all tagged nodes from anywhere
func _input(event: InputEvent) -> void:
    if event.is_action_pressed("debug_dump_enemies"):
        for enemy in get_tree().get_nodes_in_group("debug_enemies"):
            print(enemy.name, " HP: ", enemy.health, " pos: ", enemy.global_position)
// Tag nodes at runtime for batch inspection
public override void _Ready()
{
    AddToGroup("debug_enemies");
}

public override void _Input(InputEvent @event)
{
    if (@event.IsActionPressed("debug_dump_enemies"))
    {
        foreach (var node in GetTree().GetNodesInGroup("debug_enemies"))
        {
            if (node is Enemy enemy)
                GD.Print($"{enemy.Name} HP: {enemy.Health} pos: {enemy.GlobalPosition}");
        }
    }
}

_get_configuration_warnings() for @tool Scripts

Use _get_configuration_warnings() in @tool scripts to surface misconfiguration warnings directly in the editor (a yellow warning icon on the node).

@tool
extends Node3D

@export var target_path: NodePath

func _get_configuration_warnings() -> PackedStringArray:
    var warnings := PackedStringArray()
    if target_path.is_empty():
        warnings.append("target_path must be set — this node will not function without it.")
    if not get_node_or_null(target_path) is CharacterBody3D:
        warnings.append("target_path must point to a CharacterBody3D node.")
    return warnings

C#

// No #if TOOLS here: it would remove this game node from exported builds.
[Tool]
public partial class EnemySpawner : Node3D
{
    [Export] public NodePath TargetPath { get; set; }

    public override string[] _GetConfigurationWarnings()
    {
        var warnings = new System.Collections.Generic.List<string>();
        if (TargetPath == null || TargetPath.IsEmpty)
            warnings.Add("TargetPath must be set.");
        return warnings.ToArray();
    }
}

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts29d3 checks · Risk SAFE
  • Gen Agent Trust Hub29d

    The skill provides standard debugging techniques, code snippets, and systematic workflows for Godot engine development in GDScript and C#. No security risks were identified.

  • Socket29d

    No alerts

  • Snyk29d

    Risk: LOW · No issues

Signed by skilld at 426e8ab. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last month

README badge

README badge for jame581/godotprompter/godot-debugging