Material Box

Material Box

WEB Design & Material Images

Godot - Switching Scenes

Godot

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")

Godot

TitleGodot - Switching Scenes

CategoryGodot

Created

Update

AuthorYousuke.U