Skip to content

In‐Game Debugging

Valk edited this page Oct 4, 2024 · 21 revisions

If the videos do not load please try refreshing the page.

2024-09-10.13-40-24.mp4
2024-09-08.21-37-51.mp4

Easily debug in-game by adding the [Visualize] attribute to any of the supported members. This feature allows you to visualize and interact with various types of data directly within the game environment.

Supported Members

Member Type Supported Example Types Additional Notes
Numericals int, float, double All numerical types are supported
Enums Direction, Colors All enum types are supported
Booleans bool
Strings string
Color Color
Vectors Vector2, Vector2I, Vector3, Vector3I, Vector4, Vector4I
Quaternion Quaternion
NodePath NodePath
StringName StringName
Methods Method parameters support all listed types here
Static Members This includes static methods, fields, and properties
Arrays int[], string[], Vector2[] Arrays support all listed types here
Lists List<string[]>, List<Vector2> Lists support all listed types here
Dictionaries Dictionary<List<Color[]>, Vector2> Dictionaries support all listed types here
Structs struct
Classes class
Resources Resource
Godot Classes PointLight2D, CharacterBody3D
Godot Array Godot.Collections.Array Tracking in https://github.com/ValksGodotTools/Template/issues/58
Godot Dictionary Godot.Collections.Dictionary Tracking in https://github.com/ValksGodotTools/Template/issues/58

Important

There are some annoyances when trying to visualize members from inherited classes. I will try to solve this later.

Example Usage

// You will be able to view realtime changes to curState, Position and Rotation
[Visualize(nameof(curState), nameof(Position), nameof(Rotation))]
public partial class Player : CharacterBody2D
{
    // You will be able to edit this in-game
    [Visualize] private static int _totalPlayers;

    // Visualize will check every 1000ms if currentState gets defined
    State currentState;

    public override void _Ready()
    {
        currentState = new State("Idle");
    }

    // You will be able to execute this method in-game
    [Visualize]
    public void Attack(int damage)
}
Clone this wiki locally