Changing variables trough levels.

I have some variables stored in the third-person game mode and 2 levels, the first one is just a starting menu and the other one is the actual game. The problem is that when I try to change these variables from the menu (which is a widget) and continue to the main level the variables have not been carried through the levels and it just shows 0 when debugging.
Thanks in advance.

If you want to keep something during the game lifecycle, use GameInstance, not the GameMode. Game mode gets recreated every time level is loaded and therefore your variable is reset.

And if you want to keep something even when game is shut down, use SaveGame.

2 Likes

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