[Timeline] Change a float 0 to 1 over X seconds

Hello Community,

I have been struggling with a problem and hopefully you will ba able to give me some insight.

I want to change a value from 0 to 1 over X seconds, I was able to do that using a Timeline but the amount of seconds is fixed and I want to set it dynamically, so it would go over from 0 to 1 smoothly over any amount of seconds I wanted.

The practical usage of this for me is a boost gauge for a vehicle pawn, over an amount of seconds it will boost in increasing it’s speed and I want do deplete a resource, the time that the resource will burn will be dynamically set.

I have tried using interpolate and time handles but I can’t accurately control the time, and I have no clue how to dynamically change he Timeline. Any thoughts?

That may actually work! I wasn’t aware changing the play rate was actually an option. Thanks for helping!

I usually do it this way: set a Timeline to be exactly 1 second long, and when you need to change the time, you don’t change the time itself, but instead you change the Timeline’s Play Rate; so if you want it to last N seconds, set Play Rate to be 1 / N .

Create a Timeline Node in your blueprint (Right click, type “Add Timeline”) Double click the timeline node and add a variable. Mines called “Output Float” (as seen in figure 1)

Then setup a simple function to set the length of the timeline as seen in figure 2.

Hope this helps! Sorry it isn’t any more diverse than this! Got quite a bit of things to work on, just figured i’d try to help out real fast! Goodluck!

Thank you very much for helping, this is precisely what I was looking for, hopefully this will help others with the same doubts.

No problem!