Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Debugging and diagnostics

Debug, diagnose, and fix problems in your code.
Read time 1 minuteLast updated 7 days ago

Unity supports a range of tools for debugging and diagnosing issues in your project code.

Topic

Description

Debug C# code in UnityTrack down bugs in your scripts by attaching external debuggers and stepping through your project code as it executes.
Troubleshooting debuggingTroubleshoot common problems with attaching to and debugging the Unity Editor or Player.
The Debug classUse the Debug class in your project code to write messages and errors to the Console window.
Log files referenceLocate Unity's log files which record messages, warnings, and errors that can help you understand the source of problems in your application.
Stack trace loggingConfigure the level of stack trace information shown in Unity's log files and console to help track down problems in your scripts.
Roslyn analyzers and source generatorsUse analyzers to inspect your code for style, quality, and other issues.
Safe ModeUnderstand Unity's Safe Mode, a mode that the Unity Editor enters if there are compilation errors in your project.

Additional resources