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:
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.
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.