[SOLVED] NavMesh and stairs Unity 5.0.1f1

Hi, why can I never get the NavMesh to go up stair easily ?

I noticed in the latest Unity 5 release they have changed the advanced NavMesh settings …

Can someone please tell me what I’m doing wrong, and how to get the NavMesh up the stairs.


Maybe i’m missing something in the picture - but isn’t the navmesh going up the stairs - or is it disconnected at some point ? It’s hard to tell when not being able to rotate the view. Notice that the navmesh (being an approximation) some-times dips under the render geometry on which it’s based.

Hi, The NavMesh is broken at the very bottom of the lower steps then a third of the way up.

Then on the upper steps it’s broken at the bottom, middle and top.

I’ve tried multiple setting with mostly breaks in the NavMesh, the only fool proof solution I’ve found is to make a squashed down cube and turn it’s renderer off and us it as a ramp up the steps, but I shouldn’t need to be doing this.

ok thx for pointing it out - again it’s a bit hard to guage from an image. However - “Step Height” seems a bit low to me - if a step is slightly higher than 0.2 units it will get disconnected. Try Step Height 0.4 and let me know if it still fails.

1 Like

OK, tried that and also up to 0.6 and still many breaks …

2135953--140754--Screen Shot 2015-05-30 at 15.50.47 copy.png

On the latest screenshots it looks to me like the navmesh debug geometry just dips under the render geom. - could you annotate the gaps as before or temporarily disable the rendergeometry for the stairs ?

OK, tried another way, used the collider object to generate the NavMesh, as that is a ramp, but still have breaks at the top of each ramp !!


Why did you change the Advanced options ? As before when I had this problem I found adjusting the height inaccuracy fixed the problem !!

Thats why I have this screen grab as reference when I came across this problem.

Still - to me it looks like it’s connected - are you sure it’s broken ? Try to move the geometry down (y-axis) after baking navmesh and have another look at the navmesh, or - alternatively - calculate a path from bottom to top of stairs - drawing the path found, you can use the script below for that. It calculates a path between the GO it’s attached to and the ‘target’ GO assigned to it. Then draws a green line for the resulting path - above the navmesh

//CalculatePathTest.cs
using UnityEngine;
[ExecuteInEditMode]
public class CalculatePathTest : MonoBehaviour {
   public Transform target;
   void OnDrawGizmos () {
     if (target == null) return;

     var path = new NavMeshPath();
     NavMesh.CalculatePath (transform.position, target.position, NavMesh.AllAreas, path);

     Gizmos.color = Color.red;
     Gizmos.DrawRay (transform.position, Vector3.up);
     Gizmos.DrawRay (target.transform.position, Vector3.up);
     Gizmos.color = Color.green;
     var offset = 0.2f * Vector3.up;
     for (int i = 1; i < path.corners.Length; ++i)
       Gizmos.DrawLine (path.corners[i-1] + offset, path.corners[i] + offset);
   }
}

Jakob_Unity you are correct, after lowering the steps the NavMesh shows in full.

I don’t believe I missed a simple thing like that, I was to fixed on how it looked rather than testing it, if I’d put a NavMesh Agent on there to chase me (as I just did) he would have run up the steps (as he just did:)) with out any problems …

Thank you for your input, much appreciated, so am I right in saying it’s only cosmetic, it won’t stop any NavMesh Agents going up or down step with the NavMesh looking broke?

you’re welcome - I think you might very well get disconnected navmesh if the step height is around 0.2 (assuming metric units - that’s close to the typical step height) - better go with 0.4.

but yeah - quoting myself :

Notice that the navmesh (being an approximation) some-times dips under the render geometry on which it’s based.

Yeah, Note to myself … I really should read the replies more carefully

1 Like

Jakob, your solutions is what i have selected and work! Thank you for this solutions!

Unity need one solutions for NavMesh Editor Integrated!

Is stupid i cannot edit navmesh !

Need this “Nav Mesh Editor in the Unity editor , can help any member !” “”" Requested!“”"
can solve many problem, “like stairs” and many other!"

" NAV MESH EDITOR !" NEED ONE VERSION , OR ANY OTHER BUT MUST WORK!

Unity NEED ONE REAL NAV MESH EDITOR INTEGRATED!! with love need it!

If you look the staircase, you see, its like a line 45 degrees or staircase but its the nav mesh agent it’s like cutting the navmesh agent. So the answer is working :)! Look the image’s, you can see the first image is looking at the top, and also the second image is looking at the bottom… As you can see, the first image is looking weird because the navmesh agent, making staircase is like cutting the navmesh agent, so the second is the navmesh agent is not like a error :smile:!
You don’t need a code, just a edit “Bake”, then click “Bake” button, then wait until bake is complete, then done! :sunglasses:

The First Image:

The Second Image:

Try it! :slight_smile:

uh, I know this is solved but I was having trouble with the Navmesh on the stair object in my project, and my issue was that it was not checked as static. It’s those things that you wish you knew before you when you