I have a game with a save object that adds one and saves the score every second. This part is working perfectly, but the highscore isn’t. I have it checking every frame (event tick) if the curent score saved is higher than the current saved highscore. If it is, it saves the highscore every frame to the value of the current score.
What’s happening is it always says the highscore is just whatever the player scored last turn.
Could we see some pictures?
That sounds like you’re not properly saving your savegame object to me but it’s hard to tell and there are a couple of things that could’ve gone wrong.
Here you go, I wasn’t actually using a save game, instead it was a simplified marketplace plug in (easy save and load).
That code is driven by “Event Construct”. This means when the widget is created it’s run once and the highscore won’t update afterwards unless you create it again.
Instead you could create a custom event which updates the Highscore of your widget and trigger it on event construct AND from an external source. Or just use Event Tick within that widget to check for the current highscore.
Anyway. You need to update the text value. Because as it seems the stored highscore variable is updated properly. Only the text display isn’t!
I tried what you said (thank you for commenting) but it functioned exactly the same.
Are you sure you’re using the plugin correctly?
I don’t have access to it and have no idea how it works. But that is the most likely issue I see if you’re properly updating the highscore value driven by event tick.