Interp begin and end with Constant speed between

I’m having a problem moving components at a constant speed, but want them to start and end with an interpolation. This would give a gradual start and stop that is always the same distance, and then a consistent movement speed in between. Does anyone have any solutions for this? Thanks!

Is timeline not applicable here? You must use interp during Tick?

Without creating your own interp function, you can create a timeline with a variable and your curve between 0 and 1. Then you can take that value and multiply it by your desired constant speed each timeline update (make sure to store the initial value).

This is a very simple solution, and if you’re needing to do this behaviour all the time your own interp function (or set of them) will be needed.

269969-untitled.png

1 Like

Ok awesome! Thanks for the info. So its an actor thats being moved, how would I change the distance it can go? Ive tried a few things but they either havent worked or create infinite loops. Any thoughts on how I could change the distance?

A super cheaty way would be to just change how wide the curve in your timeline is.

You probably have something like GetActorWorldPosition() + (GetActorForwardDirection() * GetWorldDeltaSeconds() * Velocity) every update of your timeline to move the actor, so changing the width (time) of the curve will move a longer distance.

If you want to actually specify the distance without experimenting with the timeline curve width then it gets more tricky.