Problems saving high score with a branch in blueprints
I'll now post pictures of my whole blueprint so it's easy to follow along and maybe you can see a problem I can't:
The first step is just my score system then rendering it in game, the second is checking whether a save game exists then either creating or loading it, then the third is casting to my save game and saving.
As you can see in the last panel I've tried make it so before saving the highscore it checks to see if the Total Score (Float) from the scoring system is greater than the Total Score (Integer) from my save game and if it is it should then save. I thought this would work fine it makes sense but it either doesn't ever save or just saves straight away without checking if it's higher than the saved high score.
Not sure how this relates but I also have a function on one of my widgets bound to the highscore for the HUD, which should set the highscore that's saved here to some text on my HUD to show the player their highscore, however nothing shows up on the HUD when the games over whether it was higher or not, I'll leave a picture of that function as well not sure if they're related problems or not.
Thanks for the help in advance.
asked Nov 23 '15 at 12:44 PM in Blueprint Scripting
Maybe I misunderstand what you're trying to do but in your third screenshot, you set the scoree's TotalScore to your local TotalScore just before comparing the two values.
I'd expect this to result in the score never being updated - unless the score actually is a float value, in which case it'll update if the rounded value (cast to int) is different from the real score.
You'll probably want to do your branch check before updating the scoree's TotalScore value.
Follow this question
Once you sign in you will be able to subscribe for any updates here