# Have AI take only valid paths with a nav mesh

**URL:** <https://forums.unrealengine.com/t/have-ai-take-only-valid-paths-with-a-nav-mesh/2330477>\
**Category:** Blueprint\
**Tags:** ai-navigation, unreal-engine, navmesh, Blueprint, question\
**Created:** [February 13, 2025, 5:27am UTC](https://forums.unrealengine.com/t/have-ai-take-only-valid-paths-with-a-nav-mesh/2330477 "2025-02-13T05:27:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [February 13, 2025, 5:27am UTC](https://forums.unrealengine.com/t/have-ai-take-only-valid-paths-with-a-nav-mesh/2330477/1 "2025-02-13T05:27:05Z")

</div>

Hi! So I have a base with a large radius around it and a collision sphere that checks if the player is in it. The player can place relays that have smaller spheres and if they are in a relay that is connected either to the base’s sphere or to another relay that is part of a chain of relays. How can I have the bot make sure that it only takes paths that are in the spheres?

The first pic here shows how the larger sphere is the main base and the medium-sized sphere is a relay that extends the range that the bot can travel. However, the bot can only travel inside of the spheres. I’m using a navmesh and I’m wondering how I could get it to follow the relay path to the green square, resource. The additional thing here is that the relays are placed by the player, so I can’t manually place a nav mesh modifier. So if I’d end up using one, I’m not sure how to set one up dynamically. Thanks for the help!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/9/78990c062fdea22ed3b7bd43782ec995ddb1d7f2.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/2/a/b2a66b581c93cf65b560a31de2a716435b29469c.jpeg)

---

<div class="post-metadata">

**Author:** ![Extrone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/extrone/32/906554_2.png) [@Extrone](https://forums.unrealengine.com/u/Extrone)\
**Post date:** [February 13, 2025, 6:02am UTC](https://forums.unrealengine.com/t/have-ai-take-only-valid-paths-with-a-nav-mesh/2330477/2 "2025-02-13T06:02:39Z")

</div>

These might have some useful information:

> **[Overview of how to modify the Navigation Mesh in Unreal Engine | Unreal...](https://dev.epicgames.com/documentation/en-us/unreal-engine/overview-of-how-to-modify-the-navigation-mesh-in-unreal-engine#usingtheruntimegeneration(dynamicmodifiersonly))**
>
> This guide shows how to modify the Navigation Mesh in Unreal Engine.

> [@What is the purpose of the NavModifier component?](https://forums.unrealengine.com/t/what-is-the-purpose-of-the-navmodifier-component/308292/8):
>
> what are the options to configure it through C++? I have a similar problem as well [NavMesh modifier and Navmesh paths](https://forums.unrealengine.com/t/navmesh-modifier-and-navmesh-paths/496192)

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [February 13, 2025, 6:18am UTC](https://forums.unrealengine.com/t/have-ai-take-only-valid-paths-with-a-nav-mesh/2330477/3 "2025-02-13T06:18:33Z")

</div>

That’s perfect! Thank you so much!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 15, 2025, 6:19am UTC](https://forums.unrealengine.com/t/have-ai-take-only-valid-paths-with-a-nav-mesh/2330477/4 "2025-03-15T06:19:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
