Navmesh generation appears to have issues handling terrain and planes that are at 45 degree or steeper angles even if the agent max slope is set to allow for such movement. While the issue occurs at 45 degrees, it will also occur starting roughly at 44.5 degrees with a Cell Size of 19 and Cell Height of 10 (the default size for navmesh generation in a new project).

The holes in the navmesh will also move and change size as the geometry is rotated further. If you set the slope above 65, you can unlock the rotation gizmo from a set amount and gradually rotate the plane to see the holes move and change size at each new slope. The original comment by the licensee mentions 45 degrees, but it is not isolated to only that slope.

While reproducing this behavior, it was noted that changing the Cell Size used by the navmesh generation can affect the quality of the navmesh generated on the plane at 45 degrees and slightly beyond. With a Cell Size of 10, the plane appears to have the proper navmesh at 45 degrees, but rotating the plane further to 58.5 degrees will cause the navmesh holes to begin appearing again.

The licensee has supplied their own current fix which consists of changing the span minimum height value in RecastRasterization::RasterizeTri. The code and exact location within that method can be found in the referenced UDN thread.

Steps to Reproduce
  1. Open a level that has navmesh or add a NavMeshBoundsVolume to the level and Build Paths.
  2. Go into Project Settings->Navigation Mesh->Generation and set the Agent Max Slope value to 65. All other generation settings can be left to their defaults.
  3. Add a plane to the level inside of the navmesh bounds.
  4. Rotate the plane to 45 degrees on its X or Y axis.

Expected Result: The plane has navmesh generated over its upwards facing surface.

Actual Result: The navmesh that is generated on the plane has holes in it that change in position and size as the navmesh is rotated to different slopes.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-164886 in the post.

Login to Vote

ComponentUE - AI - Navigation
Affects Versions5.0.35.1
Target Fix5.3
Fix Commit25084492
Main Commit25085242
CreatedSep 23, 2022
ResolvedMay 2, 2023
UpdatedMay 19, 2023