CrowdManager never calls StartUsingCustomLink() on Agents when Custom NavLinks are placed in the level and traversed

I came across this bug while trying to figure out the issue in this question HERE.

The basic issue is StartUsingCustomLink() never gets called in the CrowdManager when an AI with a UCrowdFollowingComponent begins to traverse a NavLinkProxy that has been placed in the world.

As mentioned in the answer of the other question, the link UserID always returns 0, so it believes that we never traverse a valid Custom link. The actual custom link ID seems to be offset by 1 in the navmesh tile link data.

However this ONLY works with pre-placed CustomNavLinks.

Once I attempt to spawn them dynamically the NavMesh does NOT contain the user ID’s even if I dirty the area containing the NavLink causing it to recalculate the NavMesh.

As an example; in a tile queried there are 2 CustomNavLinks one pre-placed, the other created at runtime. When requesting the LinkUserID the tile has the following links:

LogTemp: Index Requested: 0
LogTemp: Connection: 0 LinkID: 0
LogTemp: Connection: 1 LinkID: 53
LogTemp: Connection: 2 LinkID: 0

53 is the ID of the pre-placed NavLink, however it requests the link at index 0 when attempting to traverse it. (Which is wrong) and the connection at Index 2 is the one dynamically placed.

I’ve attached a sample code project built with the launcher 4.15 of the engine demoing the issue HERE. This issue is present in 4.13 as well as that is the version I originally saw this issue in.

I have yet to find a work-around which actually works in all cases, and would appreciate it if one could (hopefully) be found.


Hey FacePalm.exe,

I’m looking into the issue, and I’ll respond as soon as I have new information. I apologize for the delay.

Hi Sean,

Is there any update to this at all, or is it still being looked into?

I’ve reached out to one of our developers for some additional information, but I haven’t heard back just yet. I’ll let you know as soon as I do.

Thanks for your patience

I’ve gotten a ticket in for this issue based on one of our developer’s request:

Thank you for your report and for your patience.

Have a great day

Cheers for the update. :slight_smile:

Hi FacePalm.exe,

You have mentioned a workaround for the issue. Could you please share one? I have similar issue: when FPImplRecastNavMesh::FindStraightPath is called it adds custom links with userId == 0. And that prevents StartUsingCustomLink() from being called. (using 4.15).


The work around I mentioned is more of a hack.
You can find it HERE.

I don’t know if FindStraightPath() uses dtNavMesh::getOffMeshConnectionByRef(), but wherever it fetches the UserID you can probably do something similar.

As I mention in this question you CAN NOT add links at runtime otherwise this work-around doesn’t work.

Hope that helps. :slight_smile:

Thank you for sharing that.

Update: repro project is not a bug, navlinks placed on map are NOT a smart links.

NavLinkProxy combines multiple link types, make sure you’re using correct one: remove all entries in Point Links array.

So actually got this all working now as the comment from IceWraith fixes the issue.

Seems SimpleLinks have a higher priority over SmartLinks when the path is being calculated.

To fix the runtime spawning issue, you just need to call ForceNavigationRelevancy(true) on the SmartLink Component and all should be good.

@Epic you guys should really have better documentation somewhere