I am having problems making RichAI and Nodelink3 work linking a mesh added with NavmeshAdd.
I have a player building system and I update the a recast graph for the building mesh using NavmeshCut and NavmeshAdd. I create a moat around the building with a larger cut than the building size, then add the new building graph mesh with Navmeshadd, finally, I link the new mesh with the terrain using Nodelink3 and apply using the code snippet below.
I am using Opsives Ultimate Character Controller. Which sets IAstarAI.canMove = false. The controller calls IAstarAI.MovementUpdate to get the location to move to and controls the agents movement directly.
This all works great, the path is calculated correctly using the nodelink, except RichAI.MovmentUpdate does not appear to return movements along the Nodelink3. Sometimes the agent jumps onto the new building mesh and when it does navigates correctly
I have tried placing the nodelinks at the edge of the node and then in the center. This video shows the nodelinks in the center of the node. The big white line is the agent path. But as you can see, the agent just stops at the edge of the terrains recast graph, when it should follow the nodelink.
One other thing to note, I delay adding the Nodelinks, until pathfinding has processed the navmeshCut and navmeshAdd. Also, the nodelinks are in the Point Graph and the agent seeker ahs traversable graphs set to everything.
Is there any way to debug nodelinks? Or other possible reasons the nodelinks aren’t working?
// Called on NavmeshCut and NavmeshAdd
meshAdd.RebuildMesh();
meshAdd.ForceUpdate();
// Called for new links
AstarPath.active.AddWorkItem(() => {
foreach (var link in m_links)
{
NodeLink3 nl = link.gameObject.GetComponent<NodeLink3>();
if (nl != null)
nl.Apply(true);
//nl.Apply();
}
});