- Home /
Why my NavMeshSurface doesn't take in consideration the walls of my procedural generated maze?
Hello! I almost finished to generate procedurally my maze and, after merging floor and wall meshes into two new meshes, I proceded in applying the NavMeshSurface from script, after put the two new "big meshes" inside a gameObject parent, called Maze. I performed the bake within the Maze object with resultGO.AddComponent<NavMeshSurface> ().BuildNavMesh;
, assigning to it the NavMeshSurface script through Maze.AddComponent<NavMeshSurface> ();
, but the result doesn't satisfy me, since it doesn't take in consideration the walls, which should be the NavMeshObstacle.
This is the result I obtained: a plain NavMeshSurface with no trace of my walls. Any suggestions?
Answer by Cornelis-de-Jager · Mar 21, 2018 at 01:10 AM
That is because you need to bake the terrain, if you are adding object othe terrain afterwards it won't work because those objects havn't been baked in. You can't do what you want with the standard Unity assets.
There are other assets you can download such as A* or *A, which does dynamic/realtime path fidning.
This is what I feared the most. It's really weird, since I get good results with the floor subdivided into cell floors. There's no chance at all with Nave$$anonymous$$eshSurface?