I hadn’t noticed a serious issue until now, so I’d like to share my experience.
[Issue: Crashes when loading a save file]
Typically, the same player object is placed in different scenes (GameScene) to test operations across various scenarios.
If the player moves from Scene 1 to Scene 2, there are no issues during gameplay.
However, if you save and then load after reaching Scene 2, the game immediately freezes and crashes.
The cause is that the same player object exists in both scenes, leading to double instantiation during the load process, which results in a crash.
The solution seems simple enough? Just delete the player object from all scenes except Scene 1.
With this change, saving and loading while the player is in other scenes no longer causes crashes.
But here arises a major problem: if the player returns to Scene 1 from another scene, saves, and then loads,
it will crash again
![]()
The reason is the same as above. Since the player object exists in the node hierarchy of Scene 1, once the player leaves Scene 1, it is no longer the instantiated object within that scene. Therefore, when returning to Scene 1, the system generates an additional player object, causing a crash.
This is giving me a headache. I am creating a Metroidvania-style map where the player can freely move between multiple scenes. It would be terrible if returning to the initial Scene 1 and loading caused a crash. Is there any way to fix this?
================================================
[Issue: Position of scene tree objects when loading saves]
When a player object enters a new scene tree, where exactly in the scene tree hierarchy will the player’s node be located?
During testing, I found that when a player enters a new scene, it defaults to the very bottom of the scene tree. This makes intuitive sense. Nice!
At the same time, if you save and then load in the new scene, you’ll notice that the player’s position in the scene tree has changed↓
As shown in the image, after loading, the player (P1) automatically moves to the topmost position under the Parallax2D parent node in the scene tree. This causes objects with the same Z-sorting to appear in front of the player.
I don’t understand the reason behind this. I tried creating a new Parallax2D node, but the player only appears under this Parallax2D parent node. Under the current circumstances, is there a way to prevent P1 from jumping around in the scene node tree after loading?

