I’m guessing you mean you’re using lerp like this:
Set x to lerp(self.x, target.x, 0.01)
That does slow down as it reaches the target. But to ease as it moves away you’ll have to do something different.
I believe with the move to behavior you can specify the easing function as you move to a point. That would be the simplest solution.
You can do the same with some math and a few variables. You’ll need the start and end positions and variable to indicate progress. For example this does an ease in and out.
Var t=0
Every tick
— add dt to t
— set x to cosp(startx, endx, t)
Another idea is to use a velocity to control the motion. Could be as simple as adding 100*dt to the velocity to accelerate away. Maybe just switch between lerping accelerating away.
Yet another idea is to do the easing with a damped spring. You’d need the velocity and two variables k and d which control the spring stiffness and damping. Both are in the range of 0 to 1. Fiddle with the values to control motion. Could be useful when the target constantly moves.
Compare: dt>0
— ufo: add -k*(self.x-target.x)/dt-d*self.vx to vx
— set x to self.x+self.vx*dt