I am using a FloatingPawnMovement component to move my player. It works great. I’m implementing a “dash” function. This function uses a UCurveFloat to control the dash’s movement speed in a straight line. I update the position of the pawn using:
SetActorLocation(GetActorLocation() + DashDirection * DashTransition.GetValueDelta(), true, HitResult, ETeleportType::None);
The DashTransition struct just gives me the exact distance I need to move based on delta time. This all works great, but the problem is the pawn comes to a sudden stop when the dash ability ends.
I’ve tried tracking the frame velocity and setting the movement component’s Velocity directly when the dash ends. Also tried AddInputVector using the frame’s velocity, and using different ETeleportTypes, but the pawn always comes to an abrupt stop.
I was hoping to have a way to trick the movement component into treating an incoming velocity value the same way it does regular movement, where if I let go of the movement key it drifts to a stop.
Is there a way to do this?