How can I perform hot reload in Godot?
In the documentation for versions 3.5 and 4.3, it mentions that hot reloading is possible:
3.5: https://docs.godotengine.org/en/3.5/getting_started/introduction/godot_design_philosophy.html
4.3: https://docs.godotengine.org/en/4.3/getting_started/introduction/godot_design_philosophy.html
Godot tries to provide its own tools to answer most common needs. It has a dedicated scripting workspace, an animation editor, a tilemap editor, a shader editor, a debugger, a profiler, the ability to hot-reload locally and on remote devices, etc.
The Godot editor runs on the game engine. It uses the engine's own UI system, it can hot-reload code and scenes when you test your projects, or run game code in the editor. This means you can use the same code and scenes for your games, or build plugins and extend the editor.
But how exactly do you perform it?
For example, in Flutter, if you type r
or shift + r
in the terminal after running $ flutter run
, it performs a hot reload. How do you do something similar in Godot? Does simply saving a GDScript file trigger hot reload? (It doesn't seem to work that way for me...)
(More specifically, in Flutter, r
is hot reload
and shift + r
is hot restart
.)
I am editing GDScript using either VSCode or the editor included with Godot, and I am running it using the play button(attached below) in Godot.
Since this is a large project, providing a minimal code example might be time-consuming or even impossible. Could you simply explain the steps for performing a hot reload? Is it possible to do this using only the inspector? Is it not possible to directly modify the GDScript file for this? Also, is the hot reload triggered automatically, or do I need to press a button to initiate it?
If I can understand the correct patterns and limitations for performing hot reloads accurately, I think I’ll be able to experiment on my own. (Or, I can give up on the patterns that don’t work.)