- Home /
How to save and load `List myList`?
Let's imagine that on my first scene I spawn an item object with some random characteristics and I want to be able to save the object to inventory and load all inventory items on another scene.
Another example, I have a "build" mode where I build a car out of modules (similar to the game Bad Piggies) and I add each module to a list of gameobjects, which I use later in another scene to rebuild my car out of the modules stored in the list.
For both of these problems I need to be able to save List<GameObject> myList
on one scene and then load it on another scene. How can I do this? It seems like I cannot serialize List<GameObject> myList
Answer by swanne · Nov 09, 2021 at 08:37 PM
There are a few suggestions on this old post.
Hope you find one that works
https://gamedev.stackexchange.com/questions/110958/what-is-the-proper-way-to-handle-data-between-scenes
Your answer
Follow this Question
Related Questions
Unity Serializer scripting error 1 Answer
Serialized data not getting saved in iPhone 1 Answer
Saving using Serialization and IDs 0 Answers
Save / Load List with Prefabs instantiated in the runtime 2 Answers
how can serialize a gameobject 1 Answer