Debugging

    If your script isn't producing the expected result at runtime, you can debug it in an IDE such as Visual Studio.

    Note

    [There are lots of ways to debug code. This page suggests one method, using Visual Studio.]

    • Open the script in Visual Studio.
    Tip

    To open your project in Visual Studio from Game Studio, in the Game Studio toolbar, click (Open in IDE).

    • In Visual Studio, press F5 or click Start in the toolbar to run the game in debug mode.

    Visual Studio Start button

    The game starts in a new window. In Visual Studio, on the script page, the first break point highlights and stops the execution.

    • 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.