UMG progressbar question

How can I make the progressbar increases or decreases smoothly(like a lerp or an animation)instead of sharply change.Thanks!

You can animate increases or decreases in simple loop.

It’s example of decreasing value. Let me know if it works.

XadE

Use tick event and small delay to increase the value by a very small amount until it reaches a certain value. That way you will have a very smooth transition. If you still need help, i’m always available.

Thanks very much,However,I forgot to say that,in my case,I make a health progressbar and bind a function to it to get the player health via a blueprint interface,so the health cannot be modified outside the function…How can I make it work?Thanks again!

Thanks very much,However,I forgot to say that,in my case,I make a health progressbar and bind a function to it to get the player health via a blueprint interface,so the health cannot be modified outside the function…How can I make it work?Thanks again!

You need to leverage EVENT TICK and LERP node where you have direct control over how long it will take to finish the animation as you’ll be using DELTA TIME… the other proposed solutions will give you inaccurate results as its highly unpredictable when the next tick might occur.

In your case this is advantageous as the only thing you’ll need is the next value of health and the tick event will take care of everything else.

Thanks a lot,could you pleaase post a screenshot of what you mean?Ido not fully understand…

your player can have 2 health values: Health, and DisplayHealth. you can set Health directly when the player gets hurt, and interpolate DisplayHealth towards the value of Health. then, you just bind DisplayHealth to your widget.

Thanks very much!I tried it and it worked!Thank you all!