scene_b.gd 355 B

123456789
  1. extends Panel
  2. func _on_goto_scene_pressed():
  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 := load("res://scene_a.tscn") as PackedScene
  7. get_tree().change_scene_to_packed(scene)