0 votes

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

asked Feb 16 in Engine by Lilith&Luisa (12 points)

2 Answers

0 votes

get.tree().get_scene("res://Name.tscn")

(Name is for your scene name)

Or what do you mean?

answered Feb 16 by Schweini (176 points)
+2 votes
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()
answered Feb 16 by Dlean Jeans (3,609 points)
edited May 19 by Dlean Jeans
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.