Download

Help with stamina bar

Alright so i have sprinting set up for my game, here is the full sprinting BP
srHDboW.png

And the very last part
D3T1WUz.png

And lastly my HUD BP
9S9sFYi.png

The issue i am having is that it does not display when i start the game. Instead it will show up as a full bar when im at 0% and when it recharges it will go instantly from full to empty on the first sprint.
I am very bad at UMG’s so some help would be great.

First up, I would add to view port on begin play or do you only want it showing when he is sprinting?

Narg

Also have you used a print string to check stamina instead of widget?

Narg

Yes it was originally hooked up to a print string so i could make sure everything is working correctly, i just made it show constantly. Should have seen my mistake there haha

does it work Now or still got issue with it jumping full to empty?

Narg

It is still jumping from full to empty

Remember, progress bar goes from 0-1.

Not 100

Narg

I cant even get it to visually deplete on the bar, my blueprints seem right to me

I will do a quick one

3fb804804ae46f00aae2a80111aaa36db176f1ac.jpeg

5ed324dd0961d42ea265bce68e0a3950ad3640cc.jpeg

Binding on progress bar

5c3e44ebb4cb470abcda071bec9cb42ca4e5cb1d.jpeg

a98a9a5134ed2550615dd48a96c6d2b31fc88a55.jpeg

Narg

I tried to replicate what you did in a new template and could not get it to work. I have tried everything in my little knoledge of ue4 and blueprints to get this to work but the end result is still the same. Starts off full, does not drain when sprinting and flashes empty when stamina is out then goes back to full. I followed this tutorial for my sprinting here: https://www.youtube.com/watch?v=lfqYvPZdjsg

From what I see you’re asking the Stamina Bar to have a % fill of 0 to 100. Whereas Narg told you it needs a number between 0 and 1 to fill properly.

All you should have to do is normalize the float values you are using to produce a 0-1 scale for your percentages. This will force your values into the 0-1 scale, no matter what your actual cap is. So 50 would be .5 on a 0-100 scale, etc.