As you likely know, the Lua Debugger provides extensive additional capability over print() statements for inspecting the state of running code. You can pause running programs using breakpoints, view the live value of any variable using watches, and see the source of any error through the call stack.
However, breakpoints don’t always feel as powerful as they ought to be. Shouldn’t I be able to set breakpoints that always hit regardless of context?
Meet Universal Breakpoints. Breakpoints that are set in any context (Edit/Server/Client) will be copied to every other context and always hit. This intuitive feature is finally a reality! To cover all use cases, we’ve retained the legacy behavior as “Contextual Breakpoints”. These breakpoints will not be copied to other contexts and will only be hit if set in the same context where its parent script executes.
Edit 07/06/20 - this functionality is currently available as a Beta Feature. Turn on Studio > Beta Features > Breakpoint Replication Beta to enable it.
Where would a Roblox developer use universal breakpoints? At Universal Studios! (like Roblox Studio) haha
Anyways, several things, though:
1.
Can we have the ability to enlarge the table? Cause, to me it looks small, so I want to zoom in a little similar to how we can do that in the output window right now.
If we can right-click a breakpoint and click “go to script” or something, then we’d be able to find the script with that breakpoint much more easily (sort of the like the “zoom to” for parts).
ah yes breakpoints
something i have never used as a developer because i like to stress why my code is in the wrong place
maybe i will start using them now!
I use breakpoints a lot. I don’t see why this is helpful?
It might be that I don’t use breakpoints as effectively as I could, or just (unknown) bad programming practices of mine…
If I’m debugging something which shares code on client/server (e.g. stored in ReplicatedStorage) using a lua OOP-Like structure, where I use inheritance to different classes on server/client it is often the case I only want to break at that point if it’s called on the server or client context dependent. At the moment the functionality (in Play test mode) where you can print, click to go to the print line and add a break point and it will only be client/server side is really helpful.
Surely it would be better if I could specify a break point to only activate on client/server side rather than both? A toggle between Universal, Client or Server would be the best option?
Ok, so what am I doing wrong? I have enabled the Beta feature and restarted, but when I put a break point in module that gets replicated to the client and required in a local script the break point never trips.
It does work if I put a break point in a local script in StarterGui. However, most of my scripts are added to the PlayerGui or the Character from the server.
The server is controlling what scripts the client gets. Will the new debugger not work for scripts that are added to the client?
Unfortunately, no. Universal breakpoints only replicate across contexts within a single Studio instance. We’re exploring a couple options to support your workflow but nothing short-term.