# 'Stamina' progress bar widget - Int to Float?

**URL:** <https://forums.unrealengine.com/t/stamina-progress-bar-widget-int-to-float/423812>\
**Category:** UI\
**Tags:** stamina, binding, unreal-engine, Widget, Blueprint, question\
**Created:** [April 28, 2018, 5:03pm UTC](https://forums.unrealengine.com/t/stamina-progress-bar-widget-int-to-float/423812 "2018-04-28T17:03:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_9145a550](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9145a550](https://forums.unrealengine.com/u/anonymous_user_9145a550)\
**Post date:** [April 28, 2018, 5:03pm UTC](https://forums.unrealengine.com/t/stamina-progress-bar-widget-int-to-float/423812/1 "2018-04-28T17:03:47Z")

</div>

My stamina system was created using an Integer, but it doesn’t seem to work when binding my GetStamina script for my Stamina Progress Bar widget. I tried dividing the Integer before it’s converted to a Float but all this seems to do is send the progress bar from full to zero when I finally run out of stamina, with no animation in between.

The full stamina amount as an Integer is 100, and it runs out at 0.

Any ideas?  
Do I just have to remake my stamina system with a Float? If so, what’s the point of the Int-\>Float conversion?

Thanks.

 ![239136-stamina.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/1/2/11230bcf01366c8f42a39233eacb3dc7fd1f7a7a.png)

---

<div class="post-metadata">

**Author:** ![goncasmage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@goncasmage](https://forums.unrealengine.com/u/goncasmage)\
**Post date:** [April 28, 2018, 5:05pm UTC](https://forums.unrealengine.com/t/stamina-progress-bar-widget-int-to-float/423812/2 "2018-04-28T17:05:30Z")

</div>

The progress bar goes from 0 to 1, so in order to fill it properly, you have to convert the health to a float, then divide it by the maximum health, and feed that in the return value 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9145a550](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9145a550](https://forums.unrealengine.com/u/anonymous_user_9145a550)\
**Post date:** [April 28, 2018, 5:07pm UTC](https://forums.unrealengine.com/t/stamina-progress-bar-widget-int-to-float/423812/3 "2018-04-28T17:07:48Z")

</div>

I see now, I had to convert before I divided. Thank you so much, you are a life saver! 😃

---

<div class="post-metadata">

**Author:** ![goncasmage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@goncasmage](https://forums.unrealengine.com/u/goncasmage)\
**Post date:** [April 28, 2018, 5:10pm UTC](https://forums.unrealengine.com/t/stamina-progress-bar-widget-int-to-float/423812/4 "2018-04-28T17:10:49Z")

</div>

Oh stop it, you :3
