- Home /
How can I save gameObject?
I would like to make custom bars where you put your spells. Like in World of Warcraft when you move your spells to your bars or Hearthstone where you make your own builds. How do I save it? I know you can save stuff like float,int or position of that object, but can you actually save gameObject or work with prefabs in the code (something like apply button on prefab, but I think I've read that prefab is just something in Unity Editor)?
I think the Unity way of serialisation is using scriptable objects. Other ways could be using parsers, which read and write data to files.
Answer by $$anonymous$$ · Mar 24, 2015 at 03:56 PM
If I were to implement such a system, I would keep individual elements separate (like spells) and save the appropriate data to disk so that later I can read it and re-create the list of spells (own build). This way there is a clear separation of your game model with your game controllers (game play code).
I personally use JSON and save data in plain text (but you can also encrypt if that is required)
You can start with this http://wiki.unity3d.com/index.php?title=JSONObject
Quick JSON reference : http://www.json.org
Hope this helps!
Thanks for your reply. It looks scary, but I will look at that.
Your answer
![](https://koobas.hobune.stream/wayback/20220613191128im_/https://answers.unity.com/themes/thub/images/avi.jpg)