© Casey Hardman  2020
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-5656-5_12

12. Debugging

Casey Hardman1 
(1)
West Palm Beach, FL, USA
 

When we set up our code editor back at the very first chapter, we downloaded the “Debugger for Unity” extension in Visual Studio Code. Debugging is a fancy feature of code editors that allows us to mark any line of code as a breakpoint, causing the game to pause when we reach that line of code. Once the game is paused, we can hop over to our code editor and see the values of our variables, frozen in time, and even play out one line of code at a time while keeping the game paused.

This can be immensely useful when our code isn’t doing what we intend it to do and we want to figure out ...

Get Game Programming with Unity and C#: A Complete Beginner’s Guide 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.