[Yay I got the formatting to work!!]
So my AI will find a path using the NavProxyLinks no problem, but they won’t jump at those link. I figured there is some hook for us to implement what to do when we get there. It looks like that is the case, but that “hook” isn’t getting fired.
Looking into it, the path following comp uses SetMoveSegment to move the AI along the path. In that function, we have
// handle moving through custom nav links
if (PathPt0.CustomLinkId)
{
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
INavLinkCustomInterface* CustomNavLink = NavSys->GetCustomLink(PathPt0.CustomLinkId);
StartUsingCustomLink(CustomNavLink, SegmentEnd);
}
This seems to be the entry point for us to be able to do custom logic, but we never get in there because CustomLinkId is always 0. It looks like the customid is set after we get a path back from recast in FPImplRecastNavMesh::FindStraightPath. All this code executes fine, but the offMeshCon->userId we get from the dtOffMeshConnection is also zero. Looking that var up, the comment says
/// The id of the offmesh connection. (User assigned when the navigation mesh is built.)
unsigned int userId;
But what does “user” mean in this case? Since I’m in the recast code at this point. I’m guessing the user is the epic code base. So I’m kinda at a loss how this is applied on our end. dtCreateNavMeshData is what is called when navmesh is built and that takes a params that has a user id in it. But that userId is never set as far as I can tell.
I was wondering if I’m not seeing a code path that sets this id or if there is some magic going on that I’m missing. But how do you guys get this tech to work?