Saving Instantiated Objects
I know this question has already been asked but the solution to all of these questions was "save the position and when you load the game, instantiate that object again with the position you saved" but I can't do this in my case. Basically the object I'm instantiating is an item that gets random values when it is instantiated. If I were to instantiate it again, the values would change and the player wouldn't have his old inventory... Any ideas how I could counter that problem? Or should I not use prefabs when generating items with random values?
Hi @Aether808
Try to separate your stuff.
You have most likely unchanging prefab with mesh, renderer, some components... then you have data that defines how it behaves (jump force, movement speed, firing rate, whatever).
$$anonymous$$ake some script in your object that has this data as serializable class.
When generating new object clone, store the generated values in data class, and of course, use these from here also.
When saving, just save the data class values.
When loading, first load the data of each object, then apply the values from your load data to new object prefab clones and possibly apply some settings based on data - set / update movement component's values based on load data (for example).
Your answer
