SaveGame not working?
My SaveGame won't work. I have my blueprint below. So I have a highscore variable, and if a player has a score greater than the highscore, the highscore gets set to that score. I have that blueprint running in user interface widget. So let's say that the player had a last score of 100, and the player gets a score of 110. Then the HighScore will get set to 110. However, the highscore is still 0. I know for a fact that the score isn't the problem because I used a print string and it outputted that the highscore is 0 and the score is 110. How would i fix this? Help is appreciated! Thanks!
asked Nov 20 '18 at 06:04 PM in Blueprint Scripting
This is working one. I tested it with PrintString.
Note that, first cast and promote to variable next. As you can see below, I casted to GameModeReal and promoted to variable 'GameModeReal'
Next, I casted the save file (loaded from slot) and promoted to 'SubClass' variable. So, 'SubClass' is not a SaveGameObject directly. It's a RealSaveGame class that is inherited subclass from SaveGame class.
And then, I compared if Score(GM) is bigger than HighScore(Save) or not. If Score(GM) is bigger, then set it to HighScore(Save) and Save the SubClass to slot as SaveGameObject.
I was with the same problem. I was generate a key for a spawnable object to avoid it to be spawned again when level is loading and awlays receive a false when trying to save.
The reason for that, for me is a '|' character that i was used to generate this key. I remove it and everthing is fine. So avoid special characters from the save slot name.
answered May 03 '19 at 05:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here