Skip to main content

Debugging and the console

The Console collects messages from the editor, asset imports, plugins, your scripts and the running game: what happened, what looks wrong and what failed. This page covers severities and sources, filtering and searching, collapsed duplicates, reading a message's details, jumping to the file, entity or asset a message is about, logging from your own scripts, and the game's debug views.

Messages of every severity and source; a warning repeated five times, collapsed into one row; and the details of an error.

Open the console with CtrlShiftC or Window › Panels › Console. In the Default layout it is a tab in the bottom panels.

Read a message​

Each row shows the time, the source and the message. A count at the end of the row tells how often a collapsed message repeated, and an arrow marks a message you can open. Click a row to see its details below the list: the full message and, for errors, the exception and stack trace. You can select and copy the text.

SeverityIconMeans
MessageblueSomething happened: a scan finished, scripts compiled, a plugin loaded
WarningamberSomething looks wrong but works, such as a sprite name the texture does not have
ErrorredSomething failed: a script threw an exception, a file could not be read, a build failed
SourceMessages from
EditorThe editor itself
GameThe running game, in play mode
ScriptScript compilation, and your scripts' own logging
PluginPlugins loading and plugin code
AssetsAsset scans and imports

The toolbar at the top of the console:

ControlWhat it does
Severity buttonsShow or hide messages, warnings and errors. Each shows its count.
All sourcesShows only one source, such as Script
CollapseFolds repeated messages into one row with a count
Filter messagesShows only messages containing the text
TrashClears the console

The console keeps the newest 20,000 messages. Debug-level messages are not shown.

Go to the cause​

Double-click a message with an arrow to go to what it is about:

  • A script error opens the file at the line and column in your code editor.
  • An entity is selected and framed in the Scene panel.
  • A scene opens in the editor.
  • Another asset is selected in the Assets panel.

The code editor is set in Edit › Settings… › Editor › External code editor: a command with {file}, {line} and {column} in it, such as code -g {file}:{line}:{column} or rider --line {line} {file}. Left empty, the editor uses Visual Studio Code or Rider when either is installed, and otherwise your system's default program. See Editor settings.

Script errors​

The editor compiles your scripts when the project opens and shortly after you save a script. Errors, warnings and info diagnostics, such as the hint about building strings every frame, go to the console with their file and line, under the Script source, and the status bar shows 2 script errors. Info diagnostics are messages, so the severity buttons hide them with the other messages. Click the status bar item to see the console filtered to scripts.

A compile error, with the file and line it is in.

While scripts have errors, play mode does not start, so you never play stale code by accident.

Log from your scripts​

Scripts write to the console through Log:

Log.Info("Door opened");
Log.Warning($"No spawn point named {SpawnName}, using the origin");
Log.Error("The boss has no health bar");

Messages appear under the Script source, prefixed with the name of the entity whose script logged them, so you can tell which of twenty enemies said something. Log.Error also takes an exception, whose stack trace shows in the details. See Diagnostics and analyzers.

Look inside the running game​

In play mode, the Game panel has developer keys for seeing what the game is doing:

  • F3 shows the performance overlay, with frame times and counters.
  • F4 cycles through debug views: the map's grid, its chunks, and map objects with the outlines of colliders, colored by body type, and contact points.
  • F9 saves a profiler report of the last 600 frames.

Use the live hierarchy and inspector to read values while the game runs, and pause and step frame by frame (CtrlShiftP, F10) to catch something that happens too fast to see. See Play mode.