How do you change scenes in version 3?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lilith&Luisa

Can I have pretty much the full way on how to change scenes in version 3?

:bust_in_silhouette: Reply From: Schweini

get.tree().get_scene(“res://Name.tscn”)

(Name is for your scene name)

Or what do you mean?

:bust_in_silhouette: Reply From: Dlean Jeans
const NEW_SCENE_PATH = 'res://NewScene.tscn'
const NewScene = preload(NEW_SCENE_PATH)

This takes a String:

get_tree().change_scene(NEW_SCENE_PATH)

This takes a PackedScene:

get_tree().change_scene_to(NewScene)

Manually (for smooth scene transition, for example):

get_tree().get_root().add_child(NewScene.instance())
$OldScene.queue_free()