TExcelTAD
Home › Godot 4 with GDScript › Godot Builds, VS Code & the Debugger

Godot Builds, VS Code & the Debugger

Godot's tools fit in one download, which makes it easy to miss how much is in there: a script editor with a language server, a debugger with breakpoints and a live view of the running scene tree, two profilers and a set of performance monitors. This lesson covers which build to install, how to use an external editor such as VS Code, and the debugging tools you will use daily.

Which Godot to download

Build Contains Pick it when
Standard the editor, GDScript, GDExtension support the default; GDScript projects, web exports
.NET everything in Standard, plus C# support you want C# (needs the .NET SDK installed separately; see C# in Godot)

Both are on godotengine.org for Windows, macOS and Linux, plus official channels such as Steam and itch.io, and community packages (Flathub, Scoop, Homebrew). A few practical points:

  • Godot is portable: unzip and run. Put a file named ._sc_ or _sc_ next to the executable to make it keep its settings in a local editor_data/ folder instead of your user profile, which is handy for keeping several versions side by side.
  • Stay on one version per project and upgrade on purpose. Opening a project in a newer minor version (4.5 → 4.7) usually works but may rewrite scene and resource files. Commit before upgrading, then review the diff.
  • Release candidates and dev snapshots are on the Godot blog and the "godot-builds" repository. Try your project on them to catch regressions early, but don't ship on them.
  • Version managers such as the community tool Godots install and switch between editor versions per project.

The same editor binary also runs headless for CI: godot --headless --path . --export-release ... (see Exporting) or godot --headless -s some_script.gd, which is how every GDScript example in this course is verified.

The built-in script editor

You can stay in Godot's own editor for the whole course. Learn these:

  • Ctrl+Space autocomplete (type your variables and it gets much better: see Static Typing).
  • Ctrl+click (Cmd+click on macOS) a symbol to jump to its definition, or a class name to open its docs. F1 searches the built-in class reference, which matches docs.godotengine.org for your version.
  • Ctrl+Shift+F finds in all files; Ctrl+K toggles comments; F9 toggles a breakpoint.
  • Documentation comments (## Text above a member) appear in the inspector tooltips and in the generated docs for your own classes.
  • Dragging a node from the Scene dock into the script inserts its path; hold Ctrl while dropping to insert an @onready var line for it.

VS Code with godot-tools

Many people prefer VS Code (or another editor) for multiple cursors, Git integration and extensions. Godot supports this through its language server (LSP) and debug adapter (DAP): the editor keeps running and answers your IDE's questions.

  1. Install the godot-tools extension in VS Code. It is developed in the godotengine/godot-vscode-plugin repository and also offers syntax highlighting for .tscn and .gdshader files.
  2. In Godot, open Editor > Editor Settings > Text Editor > External. Turn on Use External Editor, set Exec Path to VS Code (code, or code.cmd on Windows) and Exec Flags to:
text
{project} --goto {file}:{line}:{col}

Recent versions fill in the flags automatically for well-known editors. 3. Keep the Godot editor open while you code. godot-tools connects to its language server on port 6005 (Editor Settings > Network > Language Server), which gives you completion, go-to-definition, hover docs and errors in VS Code. 4. For debugging from VS Code, add a launch configuration. The extension talks to the debug adapter on port 6006 (Editor Settings > Network > Debug Adapter):

json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch game",
      "type": "godot",
      "request": "launch"
    }
  ]
}

Then breakpoints set in VS Code stop the game and show variables there.

For C#, choose your IDE under Editor Settings > Dotnet > Editor instead (Visual Studio, VS Code with the C# extension, or JetBrains Rider, which also has strong GDScript support).

The debugger

When you press F5, the game runs as a separate process connected to the editor. The Debugger panel at the bottom has several tabs:

Tab What it shows
Stack Trace on a breakpoint or error: the call stack and every local and member variable
Errors runtime errors and warnings with the script line; click to jump there
Profiler time per function and per built-in callback, frame by frame (start it before playing the slow part)
Visual Profiler CPU and GPU time per rendering stage
Monitors graphs of FPS, memory, node count, draw calls, physics objects, and your own custom monitors
Video RAM textures and meshes in GPU memory
Network Profiler RPC and synchronizer traffic for multiplayer games

Other tools that save hours:

  • Remote scene tree. While the game runs, the Scene dock gets Remote and Local buttons. Remote shows the live tree of the running game; click a node to inspect and edit its properties in the running game.
  • Debug menu (top bar): Visible Collision Shapes, Visible Paths, Visible Navigation, Synchronize Scene Changes and Synchronize Script Changes (edit while the game runs).
  • The Game view (Godot 4.4 and later): the running game can be embedded in the editor's Game tab, with buttons to pause, step frames and pick nodes by clicking them in the game.
  • The breakpoint keyword in GDScript stops execution like an editor breakpoint; assert(condition, "message") stops in debug builds only.

Logging and monitors from code

Small tools that complement the debugger: push_warning() and push_error() show up in the Errors tab with a backtrace, print_debug() adds the script position, and custom monitors add your own graphs to the Monitors tab. The Performance singleton also answers questions such as "how many nodes exist" and "did I leak nodes" from code:

gdscript · try it yourself
extends Node

# frames: 0
var enemies: Array[Node] = []

func _ready():
	for i in 3:
		var e := Node2D.new()
		e.name = "Enemy%d" % i
		add_child(e)
		enemies.append(e)
	Performance.add_custom_monitor("game/enemies", _count_enemies)
	print("nodes in tree: ", Performance.get_monitor(Performance.OBJECT_NODE_COUNT))
	print("game/enemies: ", Performance.get_custom_monitor("game/enemies"))
	var stray := Node.new()          # created but never added to the tree
	print("orphan nodes: ", Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT))
	stray.free()
	print("orphan nodes after free: ", Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT))
	push_warning("Spawn point missing, using origin")
	print_debug("hp = ", 3)

func _count_enemies() -> int:
	return enemies.size()

func _exit_tree():
	Performance.remove_custom_monitor("game/enemies")
nodes in tree: 5.0
game/enemies: 3
orphan nodes: 1.0
orphan nodes after free: 0.0
WARNING: Spawn point missing, using origin
     at: push_warning (core/variant/variant_utility.cpp:1033)
     GDScript backtrace (most recent call first):
         [0] _ready (res://main.gd:19)
hp = 3
   At: res://main.gd:20:_ready()

Five nodes: the root viewport, Main and the three enemies. The orphan node count is your leak detector: nodes that exist but are in no tree, usually because of remove_child() without queue_free(). Watch it in the Monitors tab while you play through a level transition; it should return to where it started. Remove custom monitors when their owner leaves the tree, because the monitor keeps calling into it.

Other tools around Godot

  • Git: commit project.godot, scenes, scripts, .import files and export_presets.cfg; ignore the .godot/ folder (the import cache). New projects get a suitable .gitignore when you tick the version-control option. Use Git LFS for large binary art.
  • Blender: Godot imports .blend files directly when you set the Blender path in Editor Settings (it runs Blender in the background to export glTF), or import .glb/.gltf exports.
  • Aseprite, Tiled, LDtk: through importer addons, see AssetLib & Addons.

Test yourself

Which Godot build do you need to write C# scripts?

  1. The standard build
  2. The .NET build (plus the .NET SDK)
  3. Any build with the C# addon from the AssetLib
  4. Only a custom engine build

VS Code's godot-tools shows no completion for your GDScript files. What is the first thing to check?

  1. That the Godot editor is running with the project open, since the language server lives in the editor
  2. That the .NET SDK is installed
  3. That the game is exported
  4. That the file is a .tscn

How can you inspect and change a node's properties while the game is running?

  1. Only by adding print statements
  2. Switch the Scene dock to Remote and select the node in the live tree
  3. Export a debug build first
  4. Use the Video RAM tab