NavMesh Agents suffer from quicksand syndrome

When my Navmesh agents change altitude, they sink… How do I stop this from happening? I tried a smaller voxel size, enabling height maps… I don’t get it…

it’s fine at the start…

but then up the hill he stays in it!



here are my settings and the resulting mesh at that point

When you return to the start location, is he still sunken?

no…player looks fine off the slope… I’ve been playing more and more with this… making it less steep seems to be my only recourse but that limits the design of the terrain more than I think is necessary… I must be missing something to not have more resolution than this on terrain, I don’t think think nav mesh should be so janky so I’m thinking it’s user error

It’s what I suspected, though, it’s a limitation in the NavMesh tools, and not a bug in our code.
The tricky part about terrains is that there is actually quite a bit less information defining a terrain than the actual terrain itself. The actual backing of the terrain is a heightmap, which is in all likelyhood not even close to what we would call pixel perfect. This is then converted on the fly to a mesh, which unsurprisingly isn’t pixel perfect either. Now we get to our NavMesh… it’s also a collection of triangles, that unsurprsingly isn’t pixel perfect… if any of these things was actually scaled to a pixel perfect resolution, your game would likely run slower than that sloth at the DMV in that movie I forgot the title of.
What AAA companies do, (and bear in mind many of them are using Unity to make their games, is pay an artist to create the level, and test it over and over again looking for any of these sorts of things, adjusting the level itself until everything looks perfect.
Our choices are A) Live with it… or B) adjust the level itself over and over again until everything looks perfect.

1 Like

You could adjust the players height with a raycast to the ground? Maybe just offsetting the model and not the capsule?

This topic was automatically closed after 14 days. New replies are no longer allowed.

Privacy & Terms