Hello,
I think there is an issue with the “Export to obj” function for the recast graph. The mesh’s normal seems to be upside down.
For now I fixed it in the RecastGraphEditor class. Can someone confirm if this is the correct fix?
//Write triangles
TriangleMeshNode nodes = tile.nodes;
for (int i = 0; i < nodes.Length; i++) {
TriangleMeshNode node = nodes[i];
if (node == null) {
Debug.LogError("Node was null or no TriangleMeshNode. Critical error. Graph type " + target.GetType().Name);
return;
}
if (node.GetVertexArrayIndex(0) < 0 || node.GetVertexArrayIndex(0) >= vertices.Length) throw new System.Exception(“ERR”);
// FIX: Swap the order of the second and third vertices to flip the normal
sb.Append(string.Format("f {0}/1 {2}/1 {1}/1\n",
(node.GetVertexArrayIndex(0) + vCount),
(node.GetVertexArrayIndex(1) + vCount),
(node.GetVertexArrayIndex(2) + vCount)));
}