Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Lilith&Luisa |
Can I have pretty much the full way on how to change scenes in version 3?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Lilith&Luisa |
Can I have pretty much the full way on how to change scenes in version 3?
Reply From: | Schweini |
get.tree().get_scene(“res://Name.tscn”)
(Name is for your scene name)
Or what do you mean?
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()