I’ve been working on a custom saving/loading system, and I’m running into a strange problem. During the load process, I use FindObject to find the Outer from a PathName written to file when re-instantiating saved objects. This worked fine for saving levels and their actors.
The SaveGame used to be in the PlayerController and load was called on BeginPlay(), but that wasn’t going to work very well for changing levels, so I moved it to the GameInstance. I originally tried calling the load function in GameInstance::Init(), but it failed to find the GameInstance every time from there. I figured it must be too early and the GameInstance wasn’t done initializing so it would never find it, so I moved the call to GameInstance::OnStart(). It works fine the first time I run PIE, but if I hit stop and run PIE again, FindObject fails to find the GameInstance.
Is this a bug or is the GameInstance just not guaranteed to be available, yet, at that point?