Another Rinterpto/Timeline question for an idiot

What’s the easiest/most logical way to set up movement so that a component/actor does a specific translation and arrives at the end at a specified time? I know where I need my AI to be, and i know exactly in how many seconds i need it to be there. I tried with the timeline and a lerp, but I couldn’t figure out how to make rate of speed work with the timeline so that it arrived at the right time(changing timeline length doesn’t seem to move the keys so that the curve itself ends at a different time?)

I tried with an rinterpto and vinterpto, and that works pretty well, but again, I can’t figure out what the interp speed relates to so I don’t know what to feed into it to have it finish at the right time (high numbers go fast/low numbers go slow, but how do I make it the exact right length? What exactly does interp speed refer to?)

Anyone have any ideas?

What about something like this:


You have “Start Point”, “End Point” and you interpolate an Actor between this two positions. In Timeline you can define time of the movement.

Source: How to lerp between 2 locations(vector) by delta time to make the character animation move between these locations? - Character & Animation - Unreal Engine Forums

The timelines aren’t 100% reliable. They don’t always calculate the same number of frames in a given time period. They’re reliant on FPS, which makes them a “loose” method at best.

However, they’re close enough. A 5 second timeline takes “about” 5 seconds…which should be good enough in most entertainment projects. It would be off by a fraction if tested.

Keep your timeline’s data curve between 0 and 1 and use it as the alpha for your Lerp. This IS actually the preferred method for accomplishing exactly what you are trying to do.

I discussed it quite a while ago in a video if you want more information.

Please bear in mind some of the info in this video will surely be deprecated/updated.

Ok good to know that this is the approach that i should be focusing on. I have that implemented, but i was having a hard time dynamically setting the length of the animation. (I know the time of animation, but i know it in a “dynamic/query’d from scene” sort of way). Set Timeline Length just sets how much of the curve gets played, it doesn’t adjust the length of the curve at all.

Am i missing something? If i have my target duration (say 2.2), and my curve length (1) Should i be using set playrate as 1/2.2?

Ok I got home and tried doing that (length of animation as 1, playrate = 1/durationOfAnimation) and it worked! Thanks for the help!