Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Payotz | |
Old Version | Published before Godot 3 was released. |
So, I have two scenes. Second scene is a minigame, and first scene is the normal game.
I want to change_scene() to the minigame, and after the minigame finishes, go back to the last scene.
I’ve been using get_tree().get_current_scene().get_path() and storing it to a global Singleton.
[global.lastScene]
The problem is, it’s a nodepath, and it doesn’t change_scene.
I tried storing get_tree().get_current_scene() into the singleton and switch to it using get_tree().set_current_scene() but for some reason, it doesn’t switch to it.
Printing global.lastScene causes it to crash.
So, how do I change_scene() using a NodePath?