Accessing GameInstance from anywhere


Is it possible to get a pointer to the current GameInstance from structs and UObjects?

If not, what’s the best way to access a class that initializes some dynamic data at runtime?

I’ve tried using a game singleton, but it constructs when you launch the editor, and destructs when you quit the editor. GameInstance is better in this case because i want it to be instanced while playing only. There’s also an instance created for each client if you’re testing multiplayer. As far as i’m aware.

In my case the singleton feature wouldn’t work either because some things aren’t created yet when the singleton instance is created (GEngine for example).