Reset level but not reset variables
I'm having the same issue as this thread https://answers.unrealengine.com/questions/214804/restart-level-but-not-reset-a-variable.html but I've been unable to solve it. After reading the comments I moved the variable into a custom Game State. Essentially, to test this, what I'm doing is a quick sequence.
1) On begin Play, casting to the game state, then running through a Branch comparing an INT that's defaulted to zero, and then printing a string if it's zero. 2) I'm adding 1 to the INT.
On Exec Command: RestartLevel - the printed string will trigger every time. It won't go up to 2, 3, or 4 - it'll just print the string and add 1 to the Int, then default back to 0 to do it all again.
Essentially, I want to be able to dive back into the gameplay without playing my starting UMG sequence again, but... i'm probably going to want to keep track of variables for the long haul - like total times played, etc. Am I going about this the wrong way?
Some threads said there was a bug that was addressed in 4.8, but this seems more like a logic mistake than some sort of bug. I've also tried moving the variable into the Game Mode and still not luck.
asked Jul 21 '15 at 04:22 PM in Blueprint Scripting
Game Instance - persists through level reloads etc. survives until game close, at which point you'd save the data using the standard savegame method in the wiki.
answered Jul 22 '15 at 05:39 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here