Save/Load Object Instance to/from Slot

Hello,

Is it possible to save dynamically created objects?
Currently, it seems that only a reference is stored. Are we limited to saving plain variables in blueprints?

This works like a charm:

This does not, even though the saved data exists:

You will need to spawn and initialize any dynamic objects that are not serialized to the level.

So what you can do is make a struct that stores the Object’s Class, Name and Transform. Than when you load it back in you can spawn it at the transform location and orientation with its old name using the class type.

Hey Everynone-

The reason the second blueprint isn’t working is because the “Set Object to Save/Target” node and the “Save Game to Slot” node are never actually called. The variables being passed to the Save node are set properly but the save never actually happens. Since you are working with a dynamically created object, you could save the values for the object and then recreate it (which it seems you may be doing in the first screenshot) rather than save the object itself. Hope this information helps.

Cheers

Slight piggy back. could you take a look at Full reload or level reset before applying checkpoint? - World Creation - Epic Developer Community Forums . Thanks.

Hello,

Your confirmation does help. I came to this very conclusion several days after posting the question and I’ve been saving struct arrays since then, re-spawning the objects on run-time.

The bottom line is: the object itself is not really saved, just its reference. As soon as the object is removed from the memory, the pointer returns… well. I hope I got it right.

Thanks