I have a 3D navmesh graph - it is working great, however I’ve noticed that frequently my seekers ride the corners and edges on my graph.
I’d like to avoid this by imposing a penalty on corner/edge nodes. I already have logic in place that iterates through all nodes via a list:
AstarPath.active.data.graphs[0].GetNodes((System.Action<GraphNode>)nodeList.Add);
foreach (GraphNode node in nodeList) {
// Custom logic here
}
My question is: How can I detect if a given node is a corner? I would guess that I’d need to look at each of the nearby nodes and compare their normals, but I’m not sure what that code would look like.