I’m somewhat new to UE and I’ve looked at too many tutorials and can’t find anything on this. I’m creating some dynamic assets (created in C++) when a level loads. I need some global settings when creating the asset. I read that GameInstance remains for the duration of the game, so I derived it and put the settings there. But in the UE editor, the level and world is created before the GameInstance. So when the level is created in the editor, the engine asks my dynamic assets to create itself, but there is no GameInstance to get the config data from.
It works fine when you play in the editor. Just not in the editor itself.
If I want to store some global configuration and data that persists between levels, is there a different class I should be using? Is there a way to force the GameInstance to be created before the level loads in the editor?
While I’m at it, where’s the best place to put per-level data in C++? I’ve been putting stuff in the player character or in the player controller, but it seems odd to me to put level information in the character. I guess I could drop an invisible C++ asset into the level. What’s the best practice?