Godot Version
Godot 4.6
Question
I am just getting into game development, and are looking into how each of the systems/mechanics/whatnot are done.
The next thing on my list is maps. Specifically how loading/Deloadingmaps is done. What nodes are used? Required code?
Thank in advance!
It depends on your definition of âmapsâ, âloadingâ, and âunloadingâ.
To answer more precisely there are many ways to handle scenes in Godot, it depends pretty much entirely on your own needs.
Certain games use a ârootâ scene, and instantiate other scenes inside of it when needed, then free them to remove them when not needed. This is useful if you need certain nodes (i.e. player) to stay instantiated under the root scene while you load another scene.
Otherwise, you can simply call SceneTree.change_scene_to_file() or SceneTree.change_scene_to_packed() to switch the current scene, but it will delete all current content.
This is all described in the documentation for changing scenes manually.
1 Like