x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Need help displaying a variable in text form on my HUD

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!!

Product Version: UE 4.14
Tags:
more ▼

asked Dec 31 '16 at 12:26 AM in Blueprint Scripting

avatar image

FyrxStudio
42 2 4 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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. 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. graph_update text (Truncate shortens it to an integer to remove .#### extras)


To perform some "death" event when the Energy reaches 0..

  • Set a Timer Set Timer

  • And make the corresponding Custom Event that checks the value Death


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

set_timer.jpg (34.4 kB)
the_event.jpg (50.3 kB)
create_binding.jpg (40.1 kB)
update_text.jpg (69.0 kB)
more ▼

answered Dec 31 '16 at 01:09 AM

avatar image

Looniper
766 22 7 36

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question