Scenes

Load Scene and Add to Top of Root Node Tree

The following code will load a scene and then add it to the Root Node, rename it to MyNewScene and then make it the top node in the Root Node Tree.

var NewSceneLoad = load("res://<path_to_scene>.tscn")
var NewScene = NewSceneLoad.instantiate()
NewScene.name = "MyNewScene"
self.add_child(NewScene)
self.move_child(NewScene, 0)

Last updated