After the meeting today, I tested out the code provided in
this forum post, which gives us an (undocumented) way to access the NavMesh's mesh data. To use the data, we need it in the form of a graph with links between edge midpoints (for A*). I implemented the transformation from {vertex list, triangle list} to adjacency list representation of that graph.
To make sure this was working, I also wrote the resulting graph out into an additional mesh:
 |
| Sweet deal. |
The next thing to look into was NavMeshAgent.SetLayerCost. I created an additional area, with the default cost of 1, for the agents to walk over. At first, they both happily walked across it:
 |
| Very synchronous. |
But after modifying the layer cost for one agent, one walked around the side:
 |
| It works! |
No comments:
Post a Comment