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"

How to make stamina bar for Running? (UMG)

Hi there! I'm just having a little trouble so, that's why I' here! :D So, my question probably is simple but I'm learning UE4, and I'm still noob. So, how to create UMG based stamina bar, that would be affected by running? Of course through Blueprints. Any ideas are welcome!

Product Version: UE 4.9
more ▼

asked Nov 29 '15 at 11:14 AM in Blueprint Scripting

avatar image

27 10 13 16

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

1 answer: sort voted first

Hello BimbawZ,

There are multiple ways to do this, but if a Progression Bar works for you, you could do it this way. First, you'll need to set up a variable in your character or player controller's blueprint to track your Stamina. Be sure this is set as Editable. You'll need to link this up to your running to decrement this variable while running. After that, you can create a Progress Bar in your widget. If you select the Progress Bar, you should be able to find the Percent value and see a "Bind" option beside it. From the Bind dropdown, select "Create Binding". This will bring you to a scripting graph for the widget to calculate what the Percent will be. You can then set it up like this:

alt text

After that, if you spawn the UMG, you should be all set up. It should decrease the progress bar's percent every time you decrease the stamina. As a note, the Percent field goes from a 0 to 100 value. If your Stamina's max is something above 100, you will need to do the necessary math to get its percentage compared to your max within the Binding we created.

Hope this helps!

Edit: Grammar

staminawidget.png (61.3 kB)
more ▼

answered Nov 30 '15 at 10:51 PM

(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