Search Unity

Question Using scriptable object to save and change stats? Bad practice?

Discussion in 'Scripting' started by TheKingNuro, Apr 22, 2023.

  1. TheKingNuro

    TheKingNuro

    Joined:
    Nov 13, 2021
    Posts:
    5
    Hi!

    Currently I'm using a scriptable object with all the stats of the characters and save/load this. (I use easy save 3 to save and load this)

    This currently works really well only thing I have to pay attention to, is revert the scriptableobject at before exporting it.

    Would it be better to seperately save everything? Basically these scriptable objects are seperate characters all of them have their own seperate stats. Then the general stats I do save seperately.

    If this is bad practice please let me know.
     
  2. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,113
    Well loading/saving has nothing to do with SOs.
    Basically SOs are just to simplify Unity natively parsing custom data from YAML files.
    You get the factory-supported way of communicating values from the inspector, and serializing/deserializing these.

    But this has nothing to do with the runtime, if that's what you meant by save/load, like savegame files.