Seems like I can’t find any information about this.
I’m creating a 2D mesh (with a PolygonCollider2D, but has a mesh filter) and have tried to use both LocalNavMeshBuilder and NavMeshSurface scripts from the github for generating the navmesh, but can’t get either to work with the XY plane, only on the XZ.
Is there a way to tell the “bakerer” for it to use the Y axis instead of the Z axis or there is something more to it?
Well, did something that somewhat works.
Basically put the NavMeshSurface script on a gameobject and made a helper script.
And I did this
private void BuildNav()
{
grids.transform.rotation = Quaternion.Euler(90, 0, 0);
transform.rotation = Quaternion.Euler(0,0,0);
GetComponent<NavMeshSurface>().BuildNavMesh();
grids.transform.rotation = Quaternion.Euler(0, 0, 0);
transform.rotation = Quaternion.Euler(-90, 0, 0);
}
Grids is just a gameobject that holds all the grids, as the grids are seperate meshes.
Works suprisingly well.
Now I wonder how to pass colliders to the builder
2 Likes