scene_b.gd 359 B

123456789
  1. extends Panel
  2. func _on_goto_scene_pressed() -> void:
  3. # Change the scene to the given PackedScene.
  4. # Though it usually takes more code, this can have advantages, such as letting you load the
  5. # scene in another thread, or use a scene that isn't saved to a file.
  6. var scene: PackedScene = load("res://scene_a.tscn")
  7. get_tree().change_scene_to_packed(scene)