Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | NotImportant |
Hello everyone,
I currently making a game and in this I have a shop.
And when I press esc change the scene to a check if I really want to go back to main menu.
So its like a ‘Do you really want to quit’ scene…
And then I have a global script in which i have thevar prescene = null
.
In my Shop script i set this var to Global.prevscene = get_tree().current_scene
But if I click on ‘No, I dont want to quit’ and it should change the scene back to get_tree().change_scene(Global.prevscene)
but I get the error:
Invalid type in function ‘change scene’ in base ‘SceneTree’ Cannot convert argument 1 from Object to String
What can I do?