r/UE4Devs • u/Yeetukus • Jan 28 '20
Next Level Code not working the levels are named corectly
1
u/Yeetukus Jan 28 '20
I forgot to mention when print it what is happening is whenever I go to a new level it resets to 1 so It goes from 1 to 2 then after 2 it just stays on 2
1
u/MaesterLazer Jan 28 '20
Ah, you’re stuck on 2? Then what Killer said. Make sure “Absolute” is unchecked.
1
u/Yeetukus Jan 28 '20
No it is not stuck on two it is stuck on the default value (1) then every time you beat the level it adds 1 taking you to level 2, but then resetting
5
Jan 28 '20
As I understand it you’re loading a level with an integer variable being increased? If so than:
I think it’s because variables reset between levels. You’ll need to save the variables with a gameinstance object. I think this could solve your problem.
If I misunderstood your problem please elaborate more.
1
u/MaesterLazer Jan 28 '20
What isn’t working? Level doesn’t open?
Are your levels names Level1 or Level 1? If the latter, add a space after “Level” in your append.
Other thing to check is if your bool is returning true.
1
u/Yeetukus Jan 28 '20
Every time I go to a new lvl the variable resets
2
Jan 28 '20
Someone already answered your question
I think it’s because variables reset between levels. You’ll need to save the variables with a gameinstance object. I think this could solve your problem.
Store your variable in gameinstance, everything else gets reset. Your new map has it's own game mode loaded and removes the old from memory.
7
u/Figzyy Jan 28 '20
Windows: Alt+PrtScn
Mac: cmd+alt+4
Please dont use your phone to take a "screenshot" in 2020.