Path following thinks it has reached the destination actor while still outside of acceptance radius

Here’s what I noticed when debugging the path following component code:

In UPathFollowingComponent::UpdatePathSegment() there is the following conditional statement

else if (MoveSegmentEndIndex > PreciseAcceptanceRadiusCheckStartNodeIndex && HasReachedDestination(CurrentLocation))In the case I mentioned above the MoveSegmentEndIndex is 1 and the PreciseAcceptanceRadiusCheckStartNodeIndex is 0 so we also check HasReachedDestination(CurrentLocation).

Within that function, GoalLocation is set as follows

FVector GoalLocation = *Path->GetPathPointLocation(Path->GetPathPoints().Num() - 1);but there was a recent change to the engine code which then sets GoalLocation equal to the CurrentDestination which is the end of the current segment. The current segment will not be equal to the location of the goal actor if we’re not on the last segment of the path yet. So HasReachedDestination(CurrentLocation) will return true if the character is within the acceptance radius of the end of the current segment instead, not within the acceptance radius of the goal actor.

Maybe I’m misunderstanding the goal of these recent changes but this logic seems incorrect to me.

Steps to Reproduce

  1. Place a character with a path following component on navmesh very close to a goal actor.
  2. Configure the navmesh so the pathfinding returns a path with 3 path points (2 segments). I used an acceptance radius of 67.5.
  3. Use a MoveTo task to get the character to move to the goal actor.
  4. Observe that the path following will report that is has finished following the path before reaching the acceptance radius of the goal actor.

That is odd behavior. Would you be able to share more of your setup that reproduces this issue? I have been attempting to repro it, but so far I have not seen the issue in my testing. Are you using the default pathfollowing or crowd following?

As for why the change was made, it came from Lego FN to test reachability of the actor prior to setting the goal as the actor’s location. I do not see any changes in the function since this change was introduced on our latest in UE5 Main.

-James