changed change scene to file to call deffered so the current process ends before changing the scene

This commit is contained in:
Brazly
2026-01-16 02:21:25 +00:00
parent cf5fecaf4e
commit 41581bd2d1

View File

@@ -8,8 +8,9 @@ func _ready() -> void:
func ChangeSceneNewGame():
get_tree().change_scene_to_file("res://Scenes/Levels/office.tscn")
func _on_new_game_button_pressed() -> void:
get_tree().change_scene_to_file("res://Scenes/Levels/office.tscn")
print("changed")
call_deferred("ChangeSceneNewGame")
pass # Replace with function body.