Pathfinding Considering Actor Size

Dear unreal developer,

I would like you to ask some questions about how to get the path point which I want to move to destination.

In order to get that, I used below function and member variable.

  • MovementComponent → Detail → Nav Agent Radius Value Setting 100
    “ UNavigationPath* UNavigationSystemV1::FindPathToLocationSynchronously(…)” function return value UNavigationPath member variable TArrayPathPoints

But the path point which I got is not considered for the size of actor.(yellow line on the attached image)
So please advise me how to get the path point like a path points(blue line on the attached image file).
Bellow are the conditions w

hich need to be applied.

  1. when the path point is made, that needs to recognize the itself size(radius) and distance between obstacles.
  2. If the distance between obstacles is narrower than actor, the actor move to find out others way to reach the destination.
    *I just need to get this path point, not code and how to move this to destionation.

For those still looking for an answer:
First add new Agent to Project Settings → Navigation System → Agents → Supported Agents.
Note: Don’t forget to remove NavMeshBoundsVolumes and RecastNavMeshes from Outliner after that process. And add new NavMeshBoundsVolume.


I think your class should be extending INavAgentInterface.

TArray<FVector> YOURCLASS::FindPathBetweenPoints(const FVector& StartPoint, const FVector& EndPoint)
{
	UNavigationSystemV1* NavSystem = FNavigationSystem::GetCurrent<UNavigationSystemV1>(GetWorld());
	
	FPathFindingQuery Query(this, *NavSystem->MainNavData, StartPoint, EndPoint);
	FPathFindingResult Path = NavSystem->FindPathSync(NavAgent, Query);
	
	TArray<FVector> Locations;
	for (FNavPathPoint PathPoint : Path.Path->GetPathPoints())
	{
		Locations.Add(PathPoint.Location);
	} 
	return Locations;
}