Godot Version
4.2
Question
How can I run some code only in Debug builds of my game? Specifically, I’d like to draw some debug information using CanvasItem._draw()
but only when the game is running as a debug build.
In C# we are able to use the DEBUG
preprocessor directive, e.g:
public partial class DebugStuff : Node
{
public override void _Ready()
{
#if DEBUG
GD.Print("RAN SOME DEBUG CODE!");
#endif
}
}