You can do so, although Godot's behavior is slightly different to Unity and I'd suggest trying it in a small test project before you unintentionally change an actual working project.
The functionality you're looking for is hidden in the Scene Tree inspector of the editor, i.e. the "Scene" tab. Once your project is running and the editor is connected, it will show two new buttons/tabs right above the scene tree:
- Local shows your editor state, i.e. your boot state. You can change everything while the project is running and values will be adjusted immediately (this also includes changes within the editor's main view, e.g. modifying tile maps).
- Remote shows your the project's running scene tree/state. You can select and modify the nodes in this tree, which is your runtime state. Note that your main editor window will always stay in the Local state, but if you click on any node in the Remote scene tree, your Node Inspector will show the selected node.
I've recorded a short clip from an experimental project of mine to demonstrate this (don't mind Samus Aran running around, this is just for testing instead of developer art).
Note: The inspector will only show exported variables. In Godot 3.x, you do this by preceding them with the keyword export
. The GDScript exports documentation has more information and a lengthy example of the various options. Fortunately, most of the time one of these two is good enough:
export var some_variable_name = 5
export(int) var some_variable_name
You would replace some_variable_name
with your actual variable name and depending on which version you go with, either replace 5
with your reasonable starting value or replace int
with your actual type being used.
In Godot 4, you use the @export
keyword instead. The documentation for that version can be found here.