Saving the whole GameInstance


is it possible to save the whole GameInstance at once? At the moment I save the instance variables into GameSave variables and then save them in the savegameslot. This is quite tedious… Thank you very much for your help

Create a struct(s) or arrays of structs - this will allow you to save many variables at once.

In each of your game objects your would like saved create a script that defines what and how to save its data. Then when you call the “save game” command have it use an event dispatcher that informs each of your game objects to save its data. It is still a lot of manual coding but I don’t know any way around that, the computer isn’t going to save your game for you, you need to specify exactly what should and shouldn’t be saved, which means going through things one at a time. But with an event dispatcher you can create the code once in each object class and then the process will be automated.

Thanks a lot both of you! I’m solving the problem now with structures. I thought, because the GameInstance variables persist the level changes and they must be stored somewhere… so that you could save the GameInstance as a whole.

Greetings from Switzerland