Good afternoon!
I have quite large levels in the game, and when building a path, I encounter the problem that Unreal cannot find a path longer than a certain length.
It is clearly visible that there is a limit either in meters or in navigation tiles: if you bring any point of the route a little closer to each other, the route is located. And a little further - not anymore.
How can I increase this limit?
I use UNavigationSystemV1::FindPathToLocationSynchronously() to find the route.
I am using Unreal Engine 4.27 without modifications.
I found a solution, maybe it will be useful to someone:
UCLASS()
class SOLAR_API USolargeneQueryFilter : public UNavigationQueryFilter
{
GENERATED_BODY()
public:
void InitializeFilter(const ANavigationData &NavData, const UObject *Querier, FNavigationQueryFilter &Filter) const override {
Super::InitializeFilter(NavData, Querier, Filter);
Filter.SetMaxSearchNodes(8192);
}
};
auto path=UNavigationSystemV1::FindPathToLocationSynchronously(this, GetActorLocation(), projected_location, nullptr, USolargeneQueryFilter::StaticClass());
1 Like