|Topic was automatically imported from the old Question2Answer platform.
Im trying to make a 2D platformer game and have implemented a scene called witchwhich contains all info about the witch. The witch is the player you play as.
I want to keep the info about the witch when changing scene so i made it a global variable
So this works during a the first scen where i add the player to the game_stage scene like the image below shows
Things to note is that i have a GUI that updated the health mana etc about the player, which is updated when the scene is created and also when the players stats changes(heals, takes dmg , etc etc)
The thing is when i change scenes (done by a simple area2d and body_entered function), the stage2´s GUI tries initialize it using the global Witch variable which apparently is “previously freed instance”.
How would figuring out this ?