I have an "overworld" where the player can walk around and find dungeons/towns. When a player is overlapping one of these locations they have the option to enter them. Doing so causes them to switch scenes (to the dungeon scene where a different player scene is used, for example)
When the player exits the dungeon I want them to be able to return to the "overworld" with everything staying saved/the way it was before they entered the dungeon.
In the "playeroverworld.gd" script, I call the savescene() function from the Global.gd singleton.
this is my code for saving the overworld scene and entering a dungeon:
var root = get_tree().get_root()
saved_scene = root.get_child(root.get_child_count() -1)
var new_scene = temp_scene.instance()
This method is in a singleton called "Global.gd"
The variable "saved_scene" is also in that script.
Whenever this method is run I get a list of errors that all say:
0:00:08:0751 - Condition ' !area_in && !E ' is true.
I assume this is somehow related to the fact that the player_overworld scene is an Area2D node that checks for overlapping areas every frame. I do not know how to get rid of these errors and I am wondering if there is a better way to do scene switching and returning. I just want to have an overworld scene that is persistent and can safely be switched.