Hey there ![]()
I’ve been using this tutorial to create a save and load system for my game:
It’s basically a save and load system that saves the data to a file in a JSON format.
It’s been quite some time since I’ve built it, and I just got back into this today. I have some overall questions, that I would be super grateful to get some help for, so it’ll get a bit easier for me to dive back into my project.
I have so far instantiated a list of different prefabs as Game Objects. Once the player clicks on those objects, they get added to another list. I want the objects that are in this list saved and once I change the scene, I want them to be instantiated there.
Main question is: How can I (best) save a list of different gameObjects to a file, so they can be instantiated in another scene? They do not have to be at the same position they’ve been before. I thought about maybe instantiating all game Objects in both scenes, setting only the one’s to active, that have been saved. But I don’t know any way yet, so that the objects, that are set active, match those that have been saved. I would love to get some ideas or feedback
I have heard about using a dictionary for this cause, but I’m hesitant since I also don’t know a way to keep a consistent ID for the instantiated gameObjects.
Thank you for reading!