Hello, I have been trying to get my float variable (it’s my score for my game) to display on my HUD, I have tried endless things and nothing works. I am using RollingBall gamemode. I don’t even know if the blueprints I have setup to increase the score over time are working because I can’t see it. I have the HUD setup correctly and all and a textbox for it to use to set the number and increase it. I also what it to save my scores for a highscore system. I need it to stop increasing after another float value (energy) reaches 0, your character “dies” (runs out of energy). Then I have a menu that appears saying blah blah you ran out of energy, reset? and I want it to also show the last score that I got that round, as well as show my all time highscore, and when I get a new highscore it updates it. I would appretiate all the help!!
If you have the float (Energy) in the Ball character blueprint…
- Create the Widget.
- Click the Text you want to reflect the “energy” variable.
- On the Right, find the “Text” entry and Create a Binding.
That opens the graph editor in a function that will feed the Text content of that element.
- Cast to the rollingball character to get the Energy variable’s value.
(Truncate shortens it to an integer to remove .#### extras)
To perform some “death” event when the Energy reaches 0…
- Set a Timer
- And make the corresponding Custom Event that checks the value
Explaining how to Create and Load saves is a bit long for a response, but there are several good tutorials on how to do it.
The documentation does a pretty good job if you go through it step by step.
[Saving Games via Blueprint][5]