Debugging
Beginner Programmer
If your script isn't producing the expected result at runtime, you can debug it in an IDE such as Visual Studio.
Open the script in Visual Studio.
Press F9 to add a break point at the required places.
In Visual Studio, press F5 or click Start in the toolbar to run the game in debug mode.
The game starts in a new window. In Visual Studio, on the script page, the first break point highlights and stops the execution.
Verify the state of your variables.
Press F10 (step over) if you want to execute the code line by line, or press F5 to continue code execution.
Note
If Visual Studio doesn't stop at the break point, make sure you attached the script to an entity in the active scene.
For more information about debugging in Visual Studio, see the MSDN documentation.
See also
- Debugging in Visual Studio (MSDN documentation)
- Types of script
- Create a script
- Use a script
- Public properties and fields
- Scheduling and priorities
- Events
- Preprocessor variables