Hi,
I tried to create holes in my Navmesh but I can't get it to work. Not sure if it's a bug or if I'm missing something. Here are the steps I've taken to recreate the issue in the 2D demo:
1. I created a new empty GameObject. Then I added a Polygon Collider 2D to it and called it HoleTest:
2. Then I go the existing NavMesh2D, add 1 hole and specify HoleTest:
3. Then I press play to test. Brain completely ignores the hole I just created. I set destination accuracy to 1 but it didn't change anything.
Any help is greatly appreciated!
Comments
Will investigate.
In the meantime, you can make the code fix yourself by editing NavigationMesh.cs, and changing line 50:
From:
newPoints.Add (hole.transform.TransformPoint (holePoint));
To:
newPoints.Add (hole.transform.TransformPoint (holePoint) - transform.position);