# BP Actor to Accelerate then Decelerate to a stop at location

Hey guys,

Ok so I’ve been racking my brain over this one for about a week now without figuring out a solution, so far I’ve got my actor to accelerate to it’s max speed (I could be doing this in the worst way but the graph for it is attached), how ever when I tried to reverse this so that it was reducing the speed to zero I couldn’t figure out a way to get it to smoothly stop at a set location.

What I what it to do is turn to the ‘target’ (when I set it up I just created a dummy actor and got it’s location), accelerate towards it, than decelerate to a stop a the targets coordinates…

In short, I can decelerate but I can’t figure out how I would make it stop at that location while keeping the smooth deceleration.

Is this an object that moves between two fixed locations such as an elevator that speeds up and slows down between the designated floors or some NPC that needs to slow down just before reaching some random location set after the game starts?

It’s an RTS game so this is giving directions to an NPC unit.

The unit is a ship and you give it new coordinates to fly to, pretty much like you give orders to units in the Homeworld series.

Have no idea how I’ll do flying in formation but getting it to fly to a new set of coordinates comes first.

Ok, then it’s a bit complicated. Do you have any experience with timelines or curves in UE4?

I’ve been experimenting with timelines but am struggling to make them work in a way I need them to.

For example, using a timeline to accelerate from 0 to 400 looks awesome and smooth. But that only works when I go from a dead stop to max speed when the ship is flying straight.

If the ship needs to turn to it’s target location first, than it should only reach a max speed of say 150 (but needs to be tweakable), and than accelerate to 400 when the target is dead on.

I can’t figure out a way to make it switch to the straight on timeline properly, because if I try to jump to the 0 to 400 timeline the ship sort of jolts forward, instead of smooth acceleration.

Also the question of what do I do if it is going from 0 to 400, and than need to start deceleration at say 230.

I guess if I was to use timelines I’d need to be able to edit the key frame values during real time.

Just to simplify what I need in this post I should just state it like this:

*actor going at X speed

*distance to target is Y

*how to slow the actor down so it stops at Y

Hi Miroac,

Use an Finterp ease in/out node instead of an finterp node. PenguinTD gives a great response on the matter here: Zeroing Out Velocity on Move - Blueprint - Epic Developer Community Forums .

I tried using it but can’t seem to figure out how the ease in out node actually functions. I looked at that forum post but no one actually posts a screen of them getting the node to do anything and I can’t seem to find any documentation on how it works.

All the node tells you is that Exponent is meant to be the degree of the curve but I have no idea what alpha does or how to use it.