ue4.20 NavigationSystem 过时

[复制链接]
查看3184 | 回复2 | 2018-10-10 00:49:31 | 显示全部楼层 |阅读模式
按照官网的更新说明,更新了NavigationSystem ,但是下面代码还是报错

#include "NavigationSystem.h"

UNavigationSystemV1* NavMesh = UNavigationSystemV1::GetCurrent(this);

if (NavMesh) {

const float SearchRadius = 1000.0f;

FNavLocation RandomPt;

const bool bFound = NavMesh->GetRandomReachablePointInRadius(Bot->GetActorLocation(), SearchRadius, RandomPt);

}
报错:
  AIEnemy.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl UNavigationSystemV1::GetRandomReachablePointInRadius(struct FVector const &,float,struct FNavLocation &,class ANavigationData *,class TSharedPtr<struct FNavigationQueryFilter const ,1>)const " (__imp_?GetRandomReachablePointInRadius@UNavigationSystemV1@@QEBA_NAEBUFVector@@MAEAUFNavLocation@@PEAVANavigationData@@V?$TSharedPtr@$$CBUFNavigationQueryFilter@@$00@@@Z) referenced in function "public: void __cdecl AAIEnemy::SearchNewPoint(void)" (?SearchNewPoint@AAIEnemy@@QEAAXXZ)


solairewrite | 2018-10-10 21:59:35 | 显示全部楼层
        // 4.20版本的需要找到工程的.Build.cs文件(\Source\ProjectName\ProjectName.build.cs)
        // 在PublicDependencyModuleNames数组里,添加"NavigationSystem"
        // PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "NavigationSystem" });
        // C++代码如下:
        // #include "NavigationSystem.h"
        // UNavigationSystemV1* NavMesh = FNavigationSystem::GetCurrent<UNavigationSystemV1>(this);
回复 支持 反对

使用道具 举报

HHL | 2018-10-11 19:39:33 | 显示全部楼层
6666666666
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

3

主题

139

回帖

671

积分

初阶编码师

积分
671