# How to control the boundary distance to the water area when generating Nav Mesh 

**URL:** <https://forums.unrealengine.com/t/how-to-control-the-boundary-distance-to-the-water-area-when-generating-nav-mesh/2532469>\
**Category:** World Creation\
**Tags:** Epic-Pro-Support, unreal-engine, question\
**Created:** [April 14, 2025, 12:49am UTC](https://forums.unrealengine.com/t/how-to-control-the-boundary-distance-to-the-water-area-when-generating-nav-mesh/2532469 "2025-04-14T00:49:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 14, 2025, 12:49am UTC](https://forums.unrealengine.com/t/how-to-control-the-boundary-distance-to-the-water-area-when-generating-nav-mesh/2532469/1 "2025-04-14T00:49:07Z")

</div>

Background

- Recast Nav Mesh Generator will keep a margin distance to the boundary when generating a nav mesh

[Image Removed]

Target

- Our level designers want to have a detailed control to this distance. Currently we can only control this by changing the agent radius.
- For example, for water area, they can set a different margin value. Because they want our AI agents can keep a specific and constant distance to the water area, which is independent to the slope of the landscape.

[Image Removed]

\<br\>

What They Tried

- They have tried moving the Nav Mesh Bounds Volume upwards so that the Nav Mesh can be generated at a certain distance from the water surface.
- However, this distance is not constant because the slope of the Landscape is not exactly the same.

[Image Removed]

They also tried keeping a specific distance at the AI ​​behavior level, but this caused the agent to exhibit jagged behavior, where the AI ​​would first follow the edge of the NavMesh, then find itself too close to the edge of the water, then start moving further away, then get closer to the edge of the water again.

[Image Removed]

\<br\>

Our Questions:

- We want to know the cost if we want to modify the engine to support ‘let the LD can control the nav mesh generation margin to the water area’. If the cost is too high, we may want to change our target.
- Or, can we do this without modify the engine? ( based on my knowledge this is impossible)

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 15, 2025, 1:54pm UTC](https://forums.unrealengine.com/t/how-to-control-the-boundary-distance-to-the-water-area-when-generating-nav-mesh/2532469/2 "2025-04-15T13:54:44Z")

</div>

It’s definitely not an easy change to take control over the navmesh erosion process, but something simpler you could try

You could probably generate an oversized convex volume from the water bodies you could use as a nav modifier volume.

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 16, 2025, 5:17am UTC](https://forums.unrealengine.com/t/how-to-control-the-boundary-distance-to-the-water-area-when-generating-nav-mesh/2532469/3 "2025-04-16T05:17:25Z")

</div>

Hi Jeremy

Really thanks for your reply. And yes, we are also thinking about the way you mentioned, which is building some nav mesh modifier volumes to achieve this.

All we want is just make sure modification of the nav mesh build system is not an easy way, which is conformed by your answer.

---

<div class="post-metadata">

**Author:** ![James.Keeling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@James.Keeling](https://forums.unrealengine.com/u/James.Keeling)\
**Post date:** [April 29, 2025, 6:09pm UTC](https://forums.unrealengine.com/t/how-to-control-the-boundary-distance-to-the-water-area-when-generating-nav-mesh/2532469/4 "2025-04-29T18:09:02Z")

</div>

Jeremy is correct that there is not a simple way to modify this process. Using a volume to represent the water and apply a nav modifier to it to cut the navmesh with the navmesh stopping an agent radius away. I do not know if you are using the Water plugin in the engine, but I believe you can add an area to the water body to do something similar to this.

-James
