C
C
Chalaiyev2021-02-18 22:55:16
Unity
Chalaiyev, 2021-02-18 22:55:16

Saving in Unity3d?

Hello
, I want to save data in my game, according to the type if the character bought a new house and after restarting the game the house remained new, or if the player added another employee to the game, he remained after the restart.
At first I wanted to save Vector3 objects using serialization, but i don’t know what to do with objects that don’t have coordinates yet, for example prefabs, and in my game there are a lot of building prefabs and their levels, i.e. I don’t know how to save the object if it was taken from prefabs
I don’t know what to do for this to use in Unity: JSON, SQL, PlayerPrefs? Or something else, if anyone knows, you can tell me what to use, I myself will find information about it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Bogdan Erolskiy, 2021-02-18
@Chalaiyev

When it comes to relatively large amounts of data, I would recommend SQLite. There is such a plugin for it , I use it myself.
And so, of course, PlayerPrefs should not be used (in my opinion), its purpose as a whole comes down to a small number of user settings that have to be used often (language, font, colors). Although I read on the forums that someone drove up to 500MB there.
Json & Serialization approaches are also an option, but I think that with large amounts of stored information, the options are not optimal (or dreary and not optimal if you make a file system).

G
GavriKos, 2021-02-18
@GavriKos

Use PlayerPrefs to store json. The most legal option.
Objects that do not have coordinates in fact do not yet exist in the game world) Well, or then save what is important to you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question