Debugging scripts
The editor has a debugger for both Luau and AngelScript. It works while the game plays in the Game tab.
Stopping at a line
Section titled “Stopping at a line”- Open the script in its page and click in the margin beside a line to set a breakpoint. Click again to clear it.
- Play the game with Game > Play.
- When the script reaches the line, the game pauses and the Debugger panel opens in the Game tab. The script’s page shows the line it stopped at.
Breakpoints set or cleared while the game plays apply at once. The editor keeps them while it is open.
Looking around
Section titled “Looking around”The Debugger panel shows:
- whether the script is paused or running;
- the Call Stack, the methods that led to this line;
- the Locals, the variables where it stopped, with tables and objects to expand.
While paused, hold the mouse over a name in the script page to see its value.
Moving on
Section titled “Moving on”| Button | What it does |
|---|---|
| Continue | Run until the next breakpoint |
| Step Over | Run the current line, and stop at the next one |
| Step Into | Go into the method the current line calls |
| Break | Pause the script where it is |
There is no step out, and breakpoints have no conditions: to stop on one case, add an if around
a line and set the breakpoint there.
The debugger is for the Game tab only: a scene page’s simulate does not stop at breakpoints, and
neither does an exported game. In an exported game, Log lines are the way to
see what a script did.