Persistent Objects/Data on Level Change?

I can’t find any documentation about this :frowning:

I’ve got a setting where there is a single world map with locations that the player can travel to and enter. These locations then should get loaded as levels themselves, and unloaded when the player leaves. I’ve been learning quite a bit about using UE4, but so far everything took place inside a single level. Now I need to look beyond that level and don’t know where to start. How should I deal with this?

You can use GameInstance if you need to travel your variable to another level.

UE4 - Using Game Instances & Persistent Variables - YouTube <= here some concrete stuff about this.

Thanks for the link, just watched it. But I’ve got a question: can I use the GameInstance to keep peristent objects by referencing them? Like UObject-derived classes and maybe even actors? Or can I only store variables/values there?

From what I know you can use all type of variable, so you can use Object variable to keep them. But if you want to keep some information like the color/position/any kind of value, you’ll need to store them too if you want to reuse them.