Losing connections with prefabs

Discussion and help for Easy Save 3
Post Reply
windofwar
Posts: 2
Joined: Sat Mar 04, 2023 10:35 pm

Losing connections with prefabs

Post by windofwar »

Good afternoon
In general, I managed to configure saving system with Easy Save, but I ran into a problem.

I have an object A, which is instantiated from a prefab at runtime (production building). It contains several lists of objects B, which are also instantiated from prefabs by script (for example, production resources).
When some resource ends (Object B), its game object destroys and its also removes from the list.
When I do loading, all my resources are loading correct, but those whose game objects were removed earlier are not added to the list.
Also, new resource wich was instantiated after game was saven - isn'd deleted.
I hope screenshots will help to explain the situation.
Perhaps I am doing something wrong, or the plugin does not support such an opportunity. Thank you in advance!

Image

Image

Image
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Losing connections with prefabs

Post by Joel »

Hi there, and take for getting in contact.

First it's important to know that Easy Save can't load a reference to something which doesn't exist, so you must ensure that all objects are loaded before trying to load references to them. Sometimes it's easiest to load twice in this case: once to load all objects, and again to load references to those objects.

If this doesn't resolve you issue, please could you replicate this in a new project with a simple scene and private message it to me with instructions.
Also, new resource wich was instantiated after game was saven - isn'd deleted.
This is expected behaviour because there's no indication in the save data that this object would need to be deleted. In this case you would need to manually delete the prefab yourself before our after loading.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
windofwar
Posts: 2
Joined: Sat Mar 04, 2023 10:35 pm

Re: Losing connections with prefabs

Post by windofwar »

Double load did the trick!
Thanks a lot!
Post Reply