r/UnityHelp • u/avah_crowe • Jun 24 '21
HELP! scriptable objects losing data between sessions
my game uses a set of scriptable objects i call 'character sheets' to store all the data pertaining to each character. the character sheets have public fields for numeric data like stats, it has lists of other scriptable objects (for skills and equipment), it has sprits for character images, and it has a field for the animator to be used with that character.
between when i close down unity for the night and open it up again, the fields (other than the numeric ones ) will some times ether empty, or change to another file.
character sheets are only set one of 2 ways, either manually in the inspector, or when a you load a save file. and i know that the issue isn't with the load/save because it was working yesterday, perfectly fine, and on opening unity today its suddenly busted.
someone suggested that a hidden constructor was causing the issue, but i wrote the code my self and added no such thing. i even checked and there are no places in the code where it sets the effected variables.
I suspect that this has something to do with the editor, and if anyone has any idea what could be causing it I would very much like to know