Navigation system on 4.20

I’m rather new to Unreal, so any suggestion is welcome

I have a demo program writing with 4.18

I want to update it to 4.20

but I got linking error after modification

Basically, I just add the new UNavigationSystemV1

Undefined symbols for architecture x86_64:
 "UNavigationSystemV1::GetPrivateStaticClass()", referenced from:
  AMoveAround::GotoPoint() in MoveAround.cpp.o
  "UNavigationSystemV1::GetRandomReachablePointInRadius(FVector const&, float, FNavLocation&, ANavigationData*, TSharedPtr<FNavigationQueryFilter const, (ESPMode)1>) const", referenced from: AMoveAround::GotoPoint() in MoveAround.cpp.o
ld: symbol(s) not found for architecture x86_6

The release note of 4.20 state that the navigation module had been move out of the engine code

So how do I add navigation library to my project?

Or do I have to build the engine myself?

Epic published a python script (Box) that will tell you exactly where you should update your code and how.

Just install python 3, download the script, put it in your project’s root and run it. It’s very intuitive and you won’t have any problem using it.

We have a project with pretty complex navigation logic and with this script updating to 4.20 was super easy.

Hope it helps!

Thanks!

It did give me some instructions about how I should change my code

But I still got the UNavigationSystemV1 linking error…

I try to import NavigationSystem like this in my Target.cs and Editor.Target.cs

ExtraModuleNames.Add("NavigationSystem");

But it didn’t work

You should not add it to the Target.cs file. Thats for adding your own modules.
You should add “NavigationSystem” to the PublicDependencyModuleNames array in te Build.cs file of the module where you are using the NavigationSystem code.
Your project should link just fine that way.

It work! So thats how you add module in Unreal

Thanks for the answer!

I update my project from 4.19 to 4.20,and i meet the same problem as yours,but i can’t get the way what you use to solve it,can you told me specifically?I would greatly appreciate you,thanks

Hi, just modify the following code in your Build.cs file to add “NavigationSystem” at the end

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" ,"NavigationSystem"});

It does not work for my project! And thank a lot

I’m using 4.23 and updating from an older project from 4.15-ish, and I am getting this error: LogPython: Error: SyntaxError: invalid syntax (D:/EpicProjectFiles/Unreal Projects/mytestproject_423/NavSysPathsUpdate.py, line 184) Does anyone have any idea of what I should do to make the script work?