Loading actors from a save file


I am currently working on a save system for my game, but I have hit a wall. I iterate through all actors implementing “ISaveable” in my level. I then call a save function to gather all the information needed to reconstruct the actor when loading the game. However, I am not able to save and then load the class of the actor, because saving pointers for later uses would be pointless. Is there a way to get a pointer to a UClass by name or by path, so that I can store enough information to be able to spawn an actor from disk? Or do I have to create a static TMap mapping names to the static classes of all my actors?

Thanks you,

Thank you for the swift response I’ll check that out right now!

All UObjects should be serializable using the FArchive << operator. This will, as far as i know, keep valid pointers as well. For other classes you need to manually implement the FArchive << operator.

See A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums for more information.