Godot - Switching Scenes
This is how to switch scenes using GDScript in Godot 4.
This is an example of code for switching scenes using change_scene_to_file()
.change_scene_to_file()
has the following features:
- Specifies the path to the new scene
- The current scene is removed from memory
get_tree().change_scene_to_file("res://SceneName.tscn")