Grid Graph doesn't respect my slope limits

Hi!
I have a Grid Graph with a 60 degrees limit for my slopes but I keep getting navmesh over 90 degres walls and empty wholes (such as caves).
I’m attaching an screenshot and my settings, what am I doing wrong? Thanks

Hi

It’s a bit of an undocumented feature (implemented a long time ago when several unity tools used the same convention) that setting max climb to zero treats it as allowing any climb value.
Thus even though the slope of the terrain is less than 60 degree nodes may be connected using the ‘max climb’ limit.

I would suggest you set max climb to something like maybe 1 or 2.

Also I would recommend that you use the layered grid graph instead of the normal grid graph if you want to be able to detect caves. The normal grid graph is limited to a single layer of nodes.

Hi Aron! Thanks so much for the quick reply!
I changed to Layered Grid Graph and it worked like a charm!
Thanks so much :slight_smile:

1 Like

I am having this problem
I can set max climb to 0.01 and max slope to 2 or max climb to 10 and max slope to 2.
They dont care. They just kind of zig-zag up steep cliffs.
I must not be understanding something, because to me, max slope of 2 means they basically are unable to go up any hill side at all.

They will curl around and it looks like they are avoiding cliffs, but if I set the destination to a really steep point, they will reach it.

Also, how do you turn-off debug messages from the seeker script?

For example, below I am aware I have set the max climb to 10 and max Slope to 0.1, I have also tried max slope0.1 and max climb 0.001, the seekers dont care, they will zig-zag up hillsides if necessary.

the seeker is using AILerp

(upload://abNlqhr08nsbnedi6pJhng7FhQW.jpeg)

Could you post a screenshot of your graph?

Also, how do you turn-off debug messages from the seeker script?

Take a look at A* Inspector -> Settings -> Path Log Mode.

I figured this out. There are two grid graphs.

I was spawning a new gridgraph. I thought I was altering the one attached in editor, not aware I was spawning a brand new one, so the new one had a slope limit of 90 and max step of 0, because I was not defining them in script, while the attached one was not doing anything but existing flat.

So in this screen shot the editor interface gridgraph is different from the spawned grid graph on screen.

I sure hope I did not cause you too much headache trying to figure out what was wrong. :confused:

1 Like