I’m rather new in Unreal Engine, so I’m still trying to understand the existing class dependencies & structure.
I’m attempting to modify the way an actor ‘walks’ in the scene, but, I still to use the base navmesh, but want to add my own dependencies.
What I did so far was create a subclass AAIController, and then a subclass of UNavigationComponent and attempt to attach it to the controller using the NavComponent attribute using the PCIP. But, this crashes Unreal Editor, saying I can not modify the DefaultNavComponent.
Looking the documentation (which does not clearly state what each class does), I notice there is also a UPathFollowingComponent.
First of all UNavigationComponent if just for finding and updating paths, and it’s going away in near future since we moved that functionality to FNavigationPath itself.
What are the movement modification you’re trying to make? UPathFollowingComponent's role is to process navigation path data and instruct Pawn’s MovementComponent regarding where it should try moving. Depending on what you really want to achieve it may or may not be the right place to do it. More info would be needed to precisely answer your question.
Regarding the issue you’ve found please paste a code snippet showing how you’re making your controller use your custom navigation component class, and attach a log showing the issue, or the callstack if it actually crashes.
Thanks for your answer. Looking the the source code I was able to understand a bit better how the Pawn movement and the AI navigation works. At the moment the character movement is performed by UPathFollowingComponent which follows the data UNavigationComponent, but, does “look a head”, only altering the movement upon collision. I would like to alter that for some pawns.
I think most of things can be done through a subclass AAIController, but, I don’t want to recompute the navigation data, I would like to go a bit more low level where I can alter the class which decides the real movement of the pawn, and that seems to be UPathFollowingComponent.
Now the noob question coming back, how do I assign “my own” UPathFollowingComponent to a AAIController / APawn? I saw that AAIController::InitNavigationControl but it’s an output function according to documentation.
Also, some hints on how to display some visual debug elements.
If you could put me in the right track I would appreciate.