How to make my ai player face goal and move forward?

I have managed to make my AI player move to a specific location. However, my player moves along the axis, which looks quite unpleasant. So my idea is to have the player first turn to face the goal and then just move forward until the goal is reached. I tried to depict my idea in the picture below. The boxes are positions (not actors) given as an FVector. How do I obtain the right rotation, and how can I make my player just move forward given a linear velocity.

To obtain the rotation that is facing from a current location to a target location you can use the function FindLookAtRotation which is located in UKismetMathLibrary (check out this link UKismetMathLibrary::FindLookAtRotation | Unreal Engine Documentation).

If you’re using a nav mesh volume instead of providing a velocity value use the function “Simple Move To Location” located inside the UAIBlueprintHelper (UAIBlueprintHelperLibrary::SimpleMoveToLocation | Unreal Engine Documentation)

In case you’re not using a nav mesh volume, you can find the velocity you need to apply using the following way:

  1. TargetLocation - PlayerLocation = Vel (this will provide you with a vector named “Vel” that starts from the player’s location and faces the target location)
  2. Normalize the vector “Vel”
  3. Multiply the previously mentioned vector by X where X is the speed of the interpolation.