Debugging with a debugger
Professional software developers are familiar with code debuggers, used to test and debug programs by stopping the execution at specific lines of code and examining the state of the memory and other runtime conditions. In this section, I will give you an introduction to using the Visual Studio debugger with Unity projects. The debugger can be used in both the Unity Editor play mode, as well as in your builds running on the attached device.
With a debugger, you can set a breakpoint at a specific line of code, where the execution will stop at that line, allowing you to query the values of variables, and wait for you to step through or continue the execution of the program.
To use a debugger in the Editor play mode you do not need to make any special changes, provided you are already using Visual Studio for your code editor (or another supported interactive development environment (IDE) such as VS Code or JetBrains Rider). You can configure Unity for your...