Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

problem with ScriptableObject saveing

Discussion in 'Scripting' started by mohanadGadamse, Jun 20, 2017.

  1. mohanadGadamse

    mohanadGadamse

    Joined:
    Jun 13, 2016
    Posts:
    10
    I want to save the game settings to a ScriptableObject, for example total player point, camera settings, general settings etc.

    I was hoping to be able to change the values in the editor, as well as by the players at runtime. Unfortunately two issues have arisen, firstly the changes don't serialize between Scenc, setdirty can not be used at runtime.

    the data that the player change in run time will not be saved , and it will go back to it's default value.

    Any suggestions?
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    You could use a serializable class to store your settings. Or Json is popular :)

    I'm not familiar enough with scriptable objects for the kind of task you're hoping to achieve. I only ever sought to use them in other ways, so far.

    This doesn't directly answer your question, though. So maybe someone else can still help :)
     
    mohanadGadamse likes this.