Using the Script Editor

July 4, 2022

Using the Script Editor

Use Breakpoints

Click the blank space between the line number and the code to create a breakpoint (the breakpoint is indicated by a red dot). Click this breakpoint again to delete the breakpoint.

Through the “Markers” panel, you can view and manage all breakpoints in the current project:

When the script execution reaches the breakpoint, the execution of the script will be suspended and the script editor will pop up automatically. At this point, you can run the code line by line, view the value of the variable, view the call stack, and so on.

Watch variables

Right-click in the “Watch” panel, select “Add Watch”, and then enter the name of the variable you want to watch, you can when the breakpoint is triggered, you can view the current value of the variable.

View Call Stack

when the breakpoint is triggered, you can view the call stack of the function in the “Stack” window.

Debug Client and Server

Currently the editor does not support simultaneous debugging of client-side (UI scripts also belong to the client-side) and server-side scripts, so need to select the current debugging port in the editor menu:

If you find that you have added a breakpoint in the script, but the script does not stop execution when the line is executed, please check the following settings:
1. Check whether the script editor window is closed during operation. If the script editor is closed, the breakpoint cannot be triggered.
2. Check whether the script type and debugging port currently need to be debugged are correct. For example, if you want to debug a client script, you need to select “Debug Client” in the editor menu.