Chapter 2. Debugging

Debugging is the process of finding, identifying, and fixing bugs (errors or mistakes) in your code, and there are many ways to achieve this. To script effectively, you'll need to be aware of the most common workflows and toolsets available to you for debugging in Unity. Before considering them further, however, it's important to be aware of the general limitations of debugging and what it cannot achieve. Debugging is not a magical cure-all to remove all bugs and guarantee an error-free application. The computer scientist Edsger W. Dijkstra said, "Program testing can be used to show the presence of bugs, but never to show their absence". The crucial point is that during testing, you might encounter one or more errors. These ...

Get Mastering Unity Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.