Hot reload in Godot (instantly see changes without reloading a game)

Hot reloading is essential for productive workflow, but this term refers to 2 different features:

  1. no need to restart Godot editor
  2. no need to restart your game

As of Godot 4.2, only first feature is implemented. Please correct me, if I’m wrong, and second feature already can be enabled, too.

Godot 4.2 announcement states:

This release also contains a major and long-awaited improvement to the development workflow of extensions. After some initial work by George Marques (GH-80188), David Snopek was able to implement in-editor hot reloading (GH-80284)! Where previously an editor restart was required to pick up on the changes in a GDExtension library, updates can now be handled on the fly. This change also makes C++ scripting with extensions a more viable tool.

This is very important improvement. But what about second feature?

Working in godot-rust and Visual Studio Code, if I run “cargo build” (while game is running in the editor), I get this linker error:

error: linking with link.exe failed: exit code: 1104
<…>
= note: LINK : fatal error LNK1104: cannot open file ‘<…>\rust\target\debug\deps\game.dll’
error: could not compile game (lib) due to 1 previous error

I found this trick for C#:
https://www.reddit.com/r/godot/comments/16pjnt2/psa_c_hotreloading_works_with_this_one_simple/

If you know tricks for other GDExtensions, please share them here.

And if second feature is not ready, what are plans and status on it?

You might need to set reloadable = true as in the example:
https://godot-rust.github.io/book/intro/hello-world.html#gdextension-file

1 Like