I searched for this topic, but didnt find any other mentionings:
Im using 3.1 Godot official, and often have the need to inspect variables during runtime, but with the "bug" Issue-10703 (My bug is at the bottom) i often have to add prints to be able to kinda see what is going on, but would expect/hope for a possibility to evaluate variables/code while runtime.
Like in Java (most IDEs offer this) or javascript where you can just try out method functionalities, try out what they return and analyze variables, see if there are certain accessors.
I guess you could argue that an experienced godot-user wouldnt need that, but i myself like using that, to explore code or frameworks im not familiar with. So Imho this could be a good and uniform way for beginners (or maybe even all skill-levels) to try things out and checking states.
Duplicate of #7057, implemented in #26219.
@Reneator if you only need to inspect the current value of the variables, in the Debugger tab, you can see all variables in the current stack frame. That said, it only works when the execution breaks and you are in the "debugging mode".
@SeleckyErik I use that already, but some informations might be hidden behind a method "generate_x" and you dont know exactly what it gives back on runtime, or its rather complex. Here the debug-console comes in handy. Also you can just try out stuff in runtime at a certain point without having to change the code and try again.
But i compensated the lack of a console by changing up my code-style a bit. I work with more variables in code, to be able to just see the variables in the debugger directly, so i dont have to call the methods. (Makes for a cleaner code as well imo)
But here sometimes the debugger is unreliable. I couldnt properly reproduce it, but sometimes the debugger doesnt show the variables, despite them being instantiated 2 lines ago.
Oh, alright, good that you found your way :) Also, the bonus of using dynamic language, GDScript, is that you can add print statements on runtime, just saving the script hot-reloads it so that you don't have to restart your game, the effects are visible immediately.
@SeleckyErik That is a great info! Didnt know that yet, thank you!
Glad to help :)
Oh, alright, good that you found your way :) Also, the bonus of using dynamic language, GDScript, is that you can add
good point, I think is a bad UX design to have to go back and forth between output and debug tabs all the time though
It's not ideal, that's for sure. We can all agree that the debugger could use some UI love. :)
Most helpful comment
Oh, alright, good that you found your way :) Also, the bonus of using dynamic language, GDScript, is that you can add
printstatements on runtime, just saving the script hot-reloads it so that you don't have to restart your game, the effects are visible immediately.