@Kequc said:
My understanding is there isn't much point in making changes to your scene or code while the game is running. I'm just always starting and stopping the game to see if anything I've done works.
I'm honestly not finding official documentation on the sync features, at least with a quick Google search, but here's the GDQuest "Sync Script and Scene Changes" video. It's pretty magical.
If you're generating a big chunk of your scene tree dynamically at runtime then you might need to reload the scene. I've been defining a new debug_reload
input action then having a node in my static scene tree which is mostly just:
func _input(event: InputEvent):
if not event.is_action_pressed("debug_reload"):
return
get_tree().set_input_as_handled()
get_tree().reload_current_scene()
The islands are generated in game, I'm not pre-calculating assets. But I'm doing a lot for example with regard to gui elements that are cast on the island.
Yeah, this seems like a kind of thing where you want a hybrid workflow: edit the GUI itself in the editor, syncing instanced scene tree changes live, and then have something in place that re-runs the code figuring out where to place the GUI as it code-syncs, by either re-running it periodically or tying it to a set of more specific computations bound to an action like the whole-scene reload above.
Definitely tighter iteration options than just re-launching the scene for each change!