There are times when you’re going to want to closely examine the code during runtime and
Debug() won’t cut it. In these situations, we can attach MonoDevelop directly to the Unity process and step through code execution by using breakpoints.
Breakpoints cause the code to halt when they’re encountered. You can then use MonoDevelop to step through the code, one line at a time, to see where it goes and what it does. You can also monitor the values of variables while doing this, making it an excellent way to catch and resolve unexpected behaviors in your game.
We’re going to introduce one such behavior into our game and then use the debugger to catch it. Start by altering the PlayerController script to match ...