Prefab child changes not being loaded

Discussion and help for Easy Save 3
Post Reply
Ell223
Posts: 10
Joined: Thu Jan 07, 2021 2:42 pm

Prefab child changes not being loaded

Post by Ell223 »

Hello,

I have an issue where the changes I make to the child of an instantiated prefab are not being loaded back into the child object, but it is being instantiated twice, once with the default values, and then again with the changed values. To clarify, the parent gameobject is loaded fine, but the child is instantiated twice.

I have the prefab script attached to the prefab. I am saving a list of the instantiated gameobjects, and can see the child of these objects is stored in the json, including their updated values. The child gameobject is not a prefab and doesn't have the prefab script attached to it, it's just an empty gameobject (i.e just a transform). I am loading the objects back as a list using Load. It creates two instances of the child gameobject, the updated changed version, and the default version from the prefab.

How should this be working? It's like the reference is not matching up, so the loader doesn't know it should apply the saved values to it.

Code: Select all

ES3.Save("stockpiles", Find.instance.setStockpiles.Items.ConvertAll(x => x.gameObject));
List<GameObject> stockpiles = (List<GameObject>)ES3.Load("stockpiles");
Thanks.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Prefab child changes not being loaded

Post by Joel »

Hi there,

Just to check, are you using the latest version of Easy Save?

If so, please could you create a new project with a very basic scene which replicates this and private message it to me so I can see what is happening?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply