How can I transfer some set of data through a level change?

Hi!

How can I transfer some set of data through a level change? I have built a lobby, allowing the players to choose settings. Now I need to access those settings in another gamemode. What is the preferred way of doing this? I don’t have the same gamemode or playerstate classes after the level change. Couldn’t find any posts that seemed up to date.

I think there are usually two approaches. One is to save the game data before loading the level, then load it up when you begin the next level. See here.

Another is to make use of the GameInstance class. This persists throughout level loads so any data stored in there can be accessed at any time and shouldn’t be reset during level loads.

Thanks! I will try to use the GameInstance.