I am using a scriptable object for saving data. I know that scriptable objects are unchangeable means we can't change and save data after runtime but is there any workaround available to update it? Or write any config file (editable for user to change it) on webgl Platform. It seems that file writing permission is not available at unity Webgl.
Sorry, but it's simply not possible for browser-based applications to write any files at all. That's just not how browser-based applications work (thankfully - just imagine what bad people could do when they could write any files they want to your local filesystem while you visit their website). When you need persistence in a Unity WebGL game, then there are basically two options.
- Use the
PlayerPrefsclass. On the webGL platform , it's implemented by the indexedDB api, which works similar to browser cookies, but allows to store a lot more data in a more efficient manner.
- Create your own webservice API which allows game clients to store and retrieve savegames stored in a database you operate. You can't do that in Unity, but there are countless technologies available for doing that. Your game can then access that API with UnityWebRequest for uploading and downloading savegames.