We’ve promoted two features in our debugging army from “Beta” to “Live”! These are Universal Breakpoints and Plugin Debugging.
Universal Breakpoints make using breakpoints more intuitive by applying them across all contexts (Edit/Client/Server) by default. From here on, breakpoints set in any Script will be copied to all contexts where that script exists. This ensures that the breakpoint you set will always be hit.
New Behavior w/ Universal Breakpoints
You can still set breakpoints that are restricted to a specific context (Client/Server) by right-clicking on the Script Editor gutter and choosing the “Insert Contextual Breakpoint” option. This option only appears when in a Play mode. Contextual Breakpoints are yellow.
Plugin Debugging provides a convenient way to use the Lua debugger in Studio while creating Plugins. You may remember the flavorful release post. Plugin Debugging is Disabled by default but can be turned on from the Studio > Debugger > Plugin Debugger Enabled setting.
Enabling Plugin Debugging will create a new Service called “PluginDebugService” in the Explorer.
The source of any local plugins can be found here and you can use the full Lua debugger. Breakpoints set in these Scripts will hit. When they do, you can navigate the callstack and view variable state with the Watch window. Any edits made can be reloaded through the following options:
- Reload Plugin - reloads the plugin directly
- Save and Reload Plugin - saves the changes to your local plugin, then reloads changes
Warning: If your plugin modifies itself at run time, Save and Reload is not recommended as you will be saving the modified version of the plugin and replacing the contents on disk.