Page 1 of 1

Prefab child changes not being loaded

Posted: Mon Jan 18, 2021 4:22 pm
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.

Re: Prefab child changes not being loaded

Posted: Mon Jan 18, 2021 4:44 pm
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