After a quick Discord session, this is how we got it working:
The GameInstance
instantiates a default SaveGame
object at startup. This instance remains alive throughout the game, preventing any Access None
errors. The save menu simply uses this existing SaveGame
object to write to the assigned slot when saving or loading, keeping all save logic centralized in the GameInstance
.
To handle persistent actor destruction, we moved the logic into a custom ActorComponent
. Now, any actor that needs this behavior just adds the component. On OnDestroy()
, the component adds the unique ID to the SaveGame
. Then, on BeginPlay()
, it checks if that ID is marked for destruction and, if so, automatically destroys the actor.