How to find out why your Godot game crashes for players
The Glitchless team · November 23, 2026 · Godot 4.5 and later, desktop and mobile exports
A player says your game crashed, and on your machine it runs fine. Two different things get called a crash in a Godot game. An error is a failure the game survives: a function stops halfway, a node is missing, a file won't load, and the game carries on in a broken state. A crash is the engine itself stopping: the window closes and nothing else runs. You catch them in different ways, so set up both.
This guide catches errors with Godot's own Logger, finds crashes on the next launch, says what a release export leaves out, and points to where native crash reports come from. Each part comes with a prompt for your coding agent, from code tested on Godot 4.7.2.
The short answer
- Errors: a custom
Logger(Godot 4.5 and later) hears every engine error, script error, shader error andpush_error(), from any thread. Register it withOS.add_logger()and send what it collects to your own server, with the build and the device. - Crashes: nothing in your game runs when the engine crashes, so it can't report one as it happens. Leave a marker file while the game runs. If it's still there at the next launch, the last run didn't close normally, and its log is in
user://logs/. - Release exports have no crash handler, so a crash there prints no backtrace, and they skip most GDScript runtime checks. Test on a debug export.
- Native crash reports with a stack come from a crash reporter that hooks the engine's own crash (Sentry's Godot SDK), or from the stores: Android vitals in the Play Console, and crash reports in Xcode's Organizer.
- What every report needs: the build, the device, and what the player did just before. Those turn "it crashed" into a cause.
An error or a crash?
Start with what the player saw:
- It froze, a menu stopped answering, an enemy stopped moving: an error. The game is still running, and Godot printed something.
- The window closed, or the phone went back to its home screen: a crash, or the operating system stopped the game. Nothing in the game ran after that.
Errors are far more common, and they're the ones a script can catch. Set those up first.
Catch every error with a custom Logger
Godot 4.5 added the Logger class. Extend it, register it with OS.add_logger(), and Godot calls its _log_error() for every engine error, script error, shader error and push_error(), with the message, the function, file and line, and the error's type.
Two rules from Godot's docs:
- It can be called from other threads, even at the same time, so guard what it collects with a
Mutex. - Never call
print()orpush_error()inside it, or it calls itself.
For push_error() and engine errors, the file and line are in Godot's own C++, so the game's line comes from the first frame of the script backtrace instead.
Ask your coding agent
Collect every engine and script error in my Godot game (4.5 or later) and send them to my server, in an autoload named ErrorLog (error_log.gd): - Inside it, a class that extends Logger, registered with OS.add_logger() in _ready(). Its _log_error() keeps up to 100 errors between sends, each with its message (the rationale argument, or code when rationale is empty), where it happened, its type (error, warning, script or shader) and Time.get_ticks_msec(). - Where it happened is "file:line in function()". For push_error() and engine errors that's Godot's own C++, so when a script backtrace has frames, use the first frame's file, line and function instead (in release exports, only with Always Track Call Stacks on). - _log_error() can be called from other threads, even at the same time: guard the list with a Mutex. Never call print() or push_error() inside it, or it calls itself. Leave _log_message() empty. - Take the user name out of home folders in messages: /Users/<name>, /home/<name> and \Users\<name> become /Users/~, /home/~ and \Users\~. - Every 30 seconds, on a Timer, send what it collected (kind "errors", with the list in errors) through a send(body) function that other scripts can use too. send() adds version (application/config/version), debug (OS.is_debug_build()), os (OS.get_name()), model (OS.get_model_name()) and gpu (RenderingServer.get_video_adapter_name()), and POSTs the body as JSON with an HTTPRequest that frees itself when the request completes. Send to an address I control, in an ENDPOINT constant: ask me for it.
Tested in a debug build of Godot 4.7.2 with three mistakes in one script: a push_error(), a get_node() on a missing path and an index out of range. All three arrived with the script's own file and line, and a home folder in a message arrived as /Users/~/.... Point ENDPOINT at something you run, even a small server that appends each request to a file.
Find a crash on the next launch
When the engine crashes, scripting is already gone, so no GDScript can report it. Godot writes the crash to the log file instead, and on desktop builds it keeps the last few logs in user://logs/ (the current godot.log plus older ones, five in all by default).
So leave a marker file while the game runs and remove it on every normal way out. Godot calls the autoload's _exit_tree() whenever the game quits, from the window's close button or get_tree().quit(), so your Quit button needs nothing new. On phones, remove it too when the game goes to the background: Android and iOS can stop a suspended game at any time without telling it, and that's not a crash. If the marker is still there at the next launch, the last run ended badly: send the end of its log, with user names taken out of file paths.
Ask your coding agent
Find crashes on the next launch in my Godot game, in an autoload named CrashWatch (crash_watch.gd), added after ErrorLog, which it sends with: - While the game runs, keep a marker file, user://running.marker, holding the version (application/config/version) and the time from Time.get_datetime_string_from_system(). - Remove it in _exit_tree(), which runs on every normal way out (the window's close button, get_tree().quit()). Remove it too on NOTIFICATION_APPLICATION_PAUSED, since Android and iOS may stop the game silently from then on, and write it again on NOTIFICATION_APPLICATION_RESUMED. - At launch, before writing the marker, check whether it's still there. If it is, the last run didn't close normally: send a report with ErrorLog.send() as kind unclean_exit, with last_run (what the marker holds), log_tail (the last 4,000 characters of the newest .log in user://logs/ other than godot.log, by modified time, with user names taken out of paths the way ErrorLog does) and crash_in_log (whether that tail contains "Program crashed"). Desktop builds keep the last few logs in user://logs/; phones and the web only when file logging is on, so send an empty tail when there's no log.
Tested with OS.crash() on Godot 4.7.2, in a debug build and in a macOS release export. Both times the next launch found the marker. The debug build's log ended in Program crashed with signal 5 and a backtrace; the release export's log just stopped, with no crash line at all. When there is one, search for Program crashed: Windows builds made with Microsoft's compiler print CrashHandlerException: Program crashed instead of the signal.
File logging is on by default only on desktop. On Android and iOS, ask your coding agent to turn on Debug → File Logging → Enable File Logging (debug/file_logging/enable_file_logging) if you want the log there too; the marker works either way.
What a release export leaves out
Most players run a release export, and it reports less than the editor does:
- No crash handler. Godot builds it only into the editor and debug export templates. In a macOS release export of Godot 4.7.2, a crash left a log that simply stopped: no
Program crashedline and no backtrace. The marker above still catches it. - No function names in native frames. Godot's official binaries have no debug symbols, so even a debug export prints
??:0for engine frames. Readable native stacks need export templates you compile with symbols. - Fewer script errors. Release exports skip most GDScript runtime checks. In a macOS release export of Godot 4.7.2, a missing node, a missing file and
push_error()were still reported, but an index out of range, a missing dictionary key, a missing method and a divide by zero were not: the code carried on. A call on a typed null crashed the game. - No script lines on errors, unless you turn on Debug → GDScript → Always Track Call Stacks (
debug/settings/gdscript/always_track_call_stacks). It makes every GDScript call do a little more work.
So run your own tests and playtest bots on a debug export, where the checks are on, and let release builds report what's left.
Native crash reports
For a stack trace of the crash itself, something has to catch the engine's own crash signal, outside GDScript. These are the options, checked against each one's docs on 23 November 2026:
| Tool | What it catches in a Godot game | Native crashes | Price |
|---|---|---|---|
| Sentry for Godot | Errors, native crashes, logs and player feedback; a GDExtension for Godot 4.5+ | Windows and Linux with minidumps; macOS, iOS and Android through Sentry's platform SDKs; readable native stacks need export templates with symbols | Free for 1 user and 5,000 errors; Team from $26 a month, billed yearly |
| Android vitals (Play Console) | Crashes and ANRs from players on Google Play | Yes, Android only | Free |
| Xcode Organizer and App Store Connect | Crashes from TestFlight and App Store players | Yes, iOS only | Free |
| GameAnalytics for Godot | Error events next to its analytics; a GDExtension for Godot 4.5+ | Its docs say crashes are sent as error events; which platforms isn't stated | Free plan |
| Bugnet | Player bug reports with screenshots, errors read from the engine log once a second, crash-free rate | Not documented | Free for 100 reports; from $19 a month |
| Firebase Crashlytics | Community plugin (godot-x/firebase) for iOS and Android | Not documented for the engine | Free |
A native reporter tells you where the engine crashed. Your own error log and the events before it usually tell you why: the level, the action, the device.
Read them by build and device
Once reports arrive, three questions find the cause faster than reading them one by one:
- Group them. Count each error by its message and location, and sort by how many players hit it, not how many times it was logged: one player's loop can log a thousand.
- Split by build. An error that starts with 1.2.0 came with 1.2.0. The
versionfield is there for that. - Split by device. An error or crash only on one GPU, one OS or one phone model points at the device, not your code: an old driver, too little memory, a renderer fallback.
Errors and crashes, done for you
The Glitchless addon for Godot (4.5 and later, open source) does the error part of this guide for you. Its own Logger hears every engine, script and shader error, groups them, and sends each with its script backtrace, the last game events before it, the build and the device. Errors come ranked by how many players they hit, next to each session's frame times, levels and where players quit, and batches wait offline until there's a network.
Since version 0.7.0 it counts crashes too, the way this guide does: while a session plays it keeps a small file, and a launch that finds it sends the last session as a crashed one, with Godot's crash message and backtrace from debug builds. So crashes show in crash-free sessions, by build and device. Native stack traces of the engine itself, with symbols, still come from Sentry or the stores' crash reports. Your coding agent reads the rest over MCP: glitchless_triage ranks problems by players hit, and glitchless_get_error opens one with its stack and what came before.
Ask your coding agent
Use Glitchless to find the errors that hit the most players in my Godot game. For the top one, open it with glitchless_get_error, read its script backtrace and the events before it, find the cause in this project and fix it. Then run the game in a debug build with --autoplay to check the error is gone.
Frequently asked questions
Why do crash logs say ??:0 instead of function names?
Godot's official export templates have no debug symbols, so engine frames print as ??:0. Compile your own export templates with symbols, or use a crash reporter that takes uploaded symbols, such as Sentry.
Where is the Godot log on a player's computer?
In user://logs/godot.log, which is the game's user data folder: on Windows under %APPDATA%\Godot\app_userdata\<project name>, on macOS under ~/Library/Application Support/Godot/app_userdata/<project name>, and on Linux under ~/.local/share/godot/app_userdata/<project name>, unless the project uses a custom user directory. Phones and the web only write it if file logging is turned on.
Can a script catch a crash as it happens?
Not reliably. Godot sends NOTIFICATION_CRASH only on desktop and only when the crash handler is built in, which release exports leave out, and very little can run at that point. Read the log on the next launch instead.
Is it a crash when the phone closes my game in the background?
No. Android and iOS can stop a game in the background at any time without telling it. That's why the marker is removed on NOTIFICATION_APPLICATION_PAUSED: a game stopped there isn't reported as a crash.
Why didn't my release build report an index out of range?
Release exports leave most GDScript runtime checks out, so the code carries on instead of raising an error. Run your tests and playtests on a debug export to catch those.
Sources
- Godot docs: Logging
- Godot docs: Logger
- Godot docs: Handling quit requests
- Godot docs: File paths in Godot projects
- Godot docs: HTTPRequest
- Sentry: Godot SDK
- Sentry: Godot stack traces
- Sentry: pricing
- GameAnalytics: Godot SDK
- Bugnet for Godot
- godot-x/firebase (community plugin)
- Android vitals: crashes
- Apple: Acquiring crash reports and diagnostic logs
Something wrong or out of date? Email support@glitchless.gg and we'll fix it. Glitchless isn't affiliated with the Godot Foundation, Sentry, GameAnalytics, Bugnet, Google or Apple; product names are their owners' trademarks.