Game Instance Not Persistent?

I was trying to carry some variables over between different menus/maps, I thought game instance should be persistent? so the settings of each variables should be same for each entire game session.
But apparently my game instance variables didn’t carry over after a map loading. So what could be cause of it, or am I understanding it wrong?
Thanks.

The GI very definitely is persistent :slight_smile:

How are you testing this?

so basically I’m setting up my game’s saving system - from the menu there are 3 save slots, there are 3 buttons for each slot. Once clicked one of 3 buttons, there’s a specific variable assigned to it, so after loading a level, the game instance is supposed to carry on the variable, so once player reach a checkpoint, the game reads the variable, then it saves the game to the correct slot.
But my test shows that the GI didn’t carry on the variable after a new level is loaded. It’s strange…

So if the variable carrys on after the level is loaded, the game should be saved automatically, but in my case nothing is saved - The saving system works fine before I used game instance with a single save slot though.

I would print some debug code. The GI will carry any variables indefinitely.

I’m assuming something is going on with your save games / code.

One thing to avoid is save game slot names on less than 4 characters.

Yeah I think I’ll test it with some different ways and with print string.
The saving system is a bit too complicated to be post here… lol

1 Like

Yes it was my save system’s flaw. Spent whole night fixing a few places and now gameinstance finally works.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.