- Home /
How can I save a character during runtime using script?
I am working on a character selection and customization solution for my game. How can I generate a file that can saved so I can reload it at runtime? The solution I have lets me modify my character and attach items but I have now way to save the unique prefab.
Answer by ryanmillerca · Aug 12, 2012 at 01:19 PM
The easiest way to save player data with Unity3d is with PlayerPrefs. Kenny suggested System.IO, which also works just fine, and is very powerful, but more complex than PlayerPrefs.
Thanks for the responses. I will look into PlayerPrefs and System IO.
Venged can you vote up both of our comments please?
Can you accept my(I am $$anonymous$$enny Powell) answer please too?
Answer by TheVectorHunter · Aug 12, 2012 at 06:34 AM
I can't tell you how to save a prefab because from my knowledge I don't know how or if it's possible, but you can definitely save strings/numbers in a file on a pc. If you can make the system work using strings and numbers then look up System.IO for the .Net Framework. It is not that difficult to learn to use properly.
Answer by Venged · Aug 14, 2012 at 12:40 AM
@TheVectorHunter - Sorry I did not know about the checking thumbs up and accepting. thank you for your help.