Unable to get NavArea Flags in SetMoveSegment() using custom PathFollowingComponent derived from UCrowdFollowingComponent
So I've been following the tutorial shown HERE and have run into a wall while trying to get this working with the UCrowdFollowingComponent. (Parent)
Whenever I do a MoveTo(), SetMoveSegment() only contains a SegmentStart with NULL flags so I can't determine whether we are traversing a 'jump' segment or not using the method shown in the tutorial.
Is there another way to determine if the current Segment we are about to traverse is a specific type of NavLinkProxy, or a possible way of making the UCrowdFollowingComponent correctly use the SetMoveSegment() function?
Through testing I have found if IsCrowdSimulationEnabled() is false then SetMoveSegment() works as expected (As a majority of the component is disabled), however if we simply SuspendCrowdSteering() It still fails to work correctly.
I guess I'm looking for point in the right direction/explanation of why this doesn't work.
So after much screwing around I finally figured out I've been mostly chasing my tail getting this to work, as it's rather poorly documented/explained.
So to elaborate on my final solution:
And that should be about it. :)
So after about a week of screwing around I've come across a solution which is hacky at best.
I found the code in the CrowdManager which was supposed to be detecting smartlinks was never working, as the following line in void UCrowdManager::UpdateAgentPaths() was always returning a NavLinkId of 0:
So I ended up finding that the valid NavLinkId was offset by one in the Detour NavMesh connection data so long as we tick the 'Smart Link is relevant' box when placing a NavLink.
I ended up making the following change in DetourNavMesh.cpp so we fetch that NavLinkId instead of the invalid one.
I don't have a great grasp of how the Detour NavMesh actually works fully however, so I'm not sure this is ACTUALLY what I should be doing, and if this works in all cases.
This is really only a tentative answer until I can get an answer from someone who actually knows the system. (Not me!)
Follow this question
Once you sign in you will be able to subscribe for any updates here