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"

Is it possible to handle HUD + float Variables + press button events in one one blueprint?

Hello guys, I could use some help with the following.

I would like to do the following: Press a button (for example "F") => modify a variable (for example add 1 to an existing float of 100) => show the new value on the HUD. I tried to achieve this, and all of these work separately, but not together in one Blueprint. I was able to use Print String and made a working HUD which shows the original Set value, but the button event didn't work.

I watched all the official Unreal tutorial videos and some more but the solution eludes me.

Is it possible to do it in one Blueprint (I guess preferably in the HUD)? Any help is welcome :)

Product Version: Not Selected
more ▼

asked Aug 12 '14 at 11:57 AM in Blueprint Scripting

avatar image

33 11 16 24

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

1 answer: sort voted first

This is absolutely possible. The attached image shows a blueprint that I made that performs your example. There are three important parts to make this work.

  1. Input events must be enabled for your HUD.

  2. Setup an event handler to increment your value when the desired key is pressed. (Make sure that no other asset is consuming the keypress you are looking for)

  3. Display the value on every Draw HUD event. (Note that there seems to be a bug where the DrawText function does not work until you have changed the color from its default value. You can change it back once you have changed it to something else)

I hope this helps alt text

hudexample.png (131.1 kB)
more ▼

answered Aug 12 '14 at 05:39 PM

avatar image

36 2 3 3

avatar image Airner Aug 12 '14 at 06:55 PM

You, good Sir, are brilliant! It is working and it is great! Thanks a lot, I'm going back to make my first game :)

(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