Hi,
I want to modify the costs of the different nodes of the navmesh. To do so, I am overriding the RecastNavMesh and the FindPath method. I’ve also modified the DefaultEngine.ini file. Everthing compiles but I am missing something. When I run the game everthing works correctly and it shouldn’t because the FindPath implementation is empty. The UE4 log is also empty. I’ve been looking for any docs or tutorials but I didn’t find anything…
I’ve also tried to assign FindPath method to FindPathImplementation attr of MyRecastNavMesh but FPathFindingResult is not compatible with FFindPathPtr…
Any help will be useful.
Thanks!
The header file MyRecastNavMesh.h:
UCLASS()
class TOPDOWNCPP_API AMyRecastNavMesh : public ARecastNavMesh
{
GENERATED_BODY()
public:
FPathFindingResult FindPath(const FNavAgentProperties & AgentProperties, const FPathFindingQuery & Query);
};
And in the MyRecastNavMesh.cpp I’ve implemented a dummy behavior:
FPathFindingResult AMyRecastNavMesh::FindPath(const FNavAgentProperties& AgentProperties, const FPathFindingQuery& Query)
{
UE_LOG(LogTemp, Warning, TEXT("AMyRecastNavMesh::FindPath"));
FPathFindingResult Result;
return Result;
}
DefaultEngine.ini:
...
[/Script/Engine.NavigationSystem]
RequiredNavigationDataClassNames="/Script/MyProjectName.MyRecastNavMesh"