I have a UMG blueprint which functions as a score tracking HUD.
It tracks “Mass” of the player which is going to be linked to a size scaler and is reduced by 1 every #seconds.
Now I need “Highscore” to represent the highest count of “Mass”
However I cant seem to find out how to compare this math.
IF Mass-20 >= Highscore - Highscore = mass
Here’s the blueprint that relays the Mass score to the static text
And heres the blueprint that’s supposed to do the same for the highscore
As you can see I left the -20 out of the equation .
So it should return 20 to the Masscount variable and set highscore to 20, instead it sets highscore to 1.
How to make this work?
You are casting a boolean value to float, so it will always give 0.0 or 1.0. You should use branch node and connect the compare pin to it. Then modify “Masscount” variable only when the condition is true. It should look something like this:
I want to use mass for highscore.
The game starts with 20 mass, cause 0 mass will trigger a gameover.
I want highscore to just depict the highest amount of mass you obtained.
But let me test that blueprint above^^
tested and works, see below.
On a side note, the Math i showed had a serious typo xD
“IF Mass-20 >= Highscore - Highscore = mass”
Shouldve looked like this
IF (Mass-20)>=Highscore than highscore = Mass
Thanks for the example.
I tried using a branch when I started this one, but didnt know where id get the red node from.
Completely forgot about it.
Mass is a variable in my character blueprint, so I’m using cast to to be able to pull that one out.
But heres the working result based on your example.