As a Roblox developer, it is currently impossible for a change made to the script to be interpreted IMMEDIATELY by the debugger, while running the game.
Currently, even if I make changes to the script, these will only be interpreted after stopping the game and running it again.
Many times, while debugging, we find ourselves in situations where we have to SIMULATE different scenarios:
Manually change variable values and try them in the following lines of debugging;
Skip some lines so that they are not executed;
Change the instructions on a few lines to test the result.
If Roblox is able to address this issue, it would improve my development experience because currently, on longer debugging, if I spot any issues in the code, I am required to:
Stop everything
Open the script editor
Go to the line where I identified the problem
Make the change “blindly” (since I no longer have access to the values of the variables within the Watch window)
Readjust the breakpoints
Run the game again
Go through all the steps again until you reach the required point
Hope the change you made works
If it doesn’t work, repeat the whole process until it does…
This isn’t possible with the current execution model that Luau uses. When a thread is spawned and running, its running off compiled bytecode that would be very dangerous to change mid-execution.
You cant even do this with more featured IDEs like Visual Studio, because again, you cant really change compiled source code mid-execution safely or reliably
So, basically something like hot-reloading? I wanted this feature for a long time, and if it is possible then I’m all for it. This would be extremely helpful when dealing with UI created through libraries like Roact and Fusion, because when you want to make a very minor change to the UI in the code, you have to re-join the game every single time to see the result, which ends up wasting a lot of developer’s time that could’ve been used to progress with the development.
Hmmmm. This would be cool but it sounds like a hacky thing to do. Tedious as it is, if you’re just wanting to catch and debug runtime errors then it would probably be best to reload the game each time.
A feature like this would be fairly hardware intensive.
A cousin alternative would be running individual scripts to allow for precise script debugging but that’s just an idea.