Hi, so my game sometimes crashes when i save the game. This only happens only once in 20-30 tries but it’s still too frequent for me to ignore it. Any ideea what could go wrong and what can i do to fix it? I even tryed using try-catch but the game still crashes…
Is SaveGame an UPROPERTY? If so, then try using IsValid.
Yes, it is a UPROPERTY(). I changed if(SaveGame) to if(IsValid(SaveGame)), but there seems to be no effect.
Interesting. Well, are all the variables to be saved also UPROPERTYs?
I figured it out. I initialized the SaveGame like this:
SaveGame = GameMode->SettingsSaveGame;
SettingsSaveGame was not a UPROPERTY(). It was already GC-ed when i initialized it.
Stupid mistake on my end, sorry for wasting you time.
Yes, all variables are UPROPERTYs…