The problem is that sometimes the save file gets deleted when the player dies and the scene reloads. I can’t consistently reproduce this bug, so I’m not sure why it happens. However, I think it might occur when the player dies while another async save is in progress. This could be creating a race condition, which results in the save file being deleted.
You could make your character invulnerable to damage while it’s freshly re-spawned if the save is still taking place.
Does dying in some way trigger a save event? I doubt changing any of the variables while the save is already in progress would cause the ongoing saves values to change.
Is the savegame mechanism in some way inside of the player character?
Trying to narrow down what link could be between the death and the save file because logically they shouldn’t influence each other.
yes it saves when its died. and I think when it saves while there is anather save in progress it happens. I tried to solve like this and it seems working now