How I can smooth a progress bar on a Blueprint Component?

Hello, everyone.
I’m a novice here and I need some help understanding how I can smooth the progress bar progression for decrease or Increase.
I’m making this health system into a Blueprint Component. I’ve seen some methods using lerp and Interp, but I’m having trouble figuring out on my own.

Decrease Health Function:

Blueprint Component Event Graph:

Third Person Blueprint Event Graph:
03

Hey @MarcVCreative!

You’re missing a part! :slight_smile: You need an interp here, as you said. You need to save “PreviousHealth” (make a new variable for it) and set that before the decrease during “DecreaseHealth”. Then in the Update Health State event, use the “PreviousHealth” / “MaxHealth” as the A for the Interp, just like you ahve there with Current and Max health, which will be your B, as the Interp will go from A to B. :slight_smile:

Hope this helps! Let us know how it goes and if you need any additional assistance, we’re here!

1 Like

Interp should be this?

I’m Very lost at how I can store the “Previous Health” here.
The “Previus Health” Should store the “Current Health” before the Subtract Node?

You are correct regarding the Previous Health! Just set it to whatever CurrentHealth is, before the subtraction, right there in DecreaseHealth. Also, set “PreviousHealth” from the ReturnValue on the FInterp To, before the SetPercent, or it will only interp the first bit over and over. :slight_smile:

You should replace “UpdateHealthState” with Tick, though! Otherwise it will only update once.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.