• News

• Industries

• Learning & Support

• Community

• Marketplace

# Modify Timeline During Runtime

Hi.

Curious if anyone has a solution.
I want to modify a timeline during runtime.

Its a simple timeline that controls a lerp action. But i want to take it a step further and modify the timeline itself.
For example.

Timeline is 0.25sec and the keys are 0,0 and 0.25,1
So it goes from 0 to 1 over 0.25 seconds.

But i want to to change the time and then set the key of 1 to the new timeline.
There is a new Time input but this does not change what i need.

The use case would be to lerp a position based on time it would take to get somewhere at a specified velocity.
So if the distance is greater the time expands and if the distance is short the time contracts.

Right now i am using a shifty workaround but its error tolerance is not very robust… and also it does not exactly achieve what i want

Hey! There’s a “Set Play Rate” node for the timeline! Try using that! It won’t modify your timeline, but will achieve the effect you need! Just hook up a multiplier there and it will do what you need! Check it out!

Seconded. use Set Play Rate to control the speed of my timeline.

If you need a different curve, you can either add another curve to the existing timeline and switch based on some set of conditions, or switch to a new time line entirely.

Thx guys.
But i think for this i’m rather going with the Move Component To function.

The math for the timeline is a bit over my head.
Distance / Speed = Time
Playrate affects Time

50 units to travel at a speed of 300 = 0.1666 seconds.
And i want to modify the playrate to turn 1 second into 0.16666 then well… i get a bit lost about the formula to use. Because the playrate is constantly going to change based on the distance from the actor to the location.

The reason i did not initially go with the Move Component To function is because i was under the impression that i uses some form of NavMesh data and that i would need to switch my movement mode to flying and then back to walking once target is reached.

But i just tested the Move Component To function and it seems its almost like a lerping action and you specify the Over Time. It even worked with Z Values on the components. Which makes life a lot easier because i can then just get Actor location Distance to Target divided by speed and plug that into the over time float value.

It looks a bit neater as well.

Anycase. Thank you for the input. I did learn something new, i honestly had no idea there was a playrate for timelines. This will come in handy.
Cheers