# Navmesh not working after adding 50+ actors

**URL:** <https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356>\
**Category:** AI\
**Tags:** pathfinding, unreal-engine, navmesh, question\
**Created:** [July 8, 2016, 11:06am UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356 "2016-07-08T11:06:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hapro](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hapro](https://forums.unrealengine.com/u/hapro)\
**Post date:** [July 8, 2016, 11:06am UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356/1 "2016-07-08T11:06:43Z")

</div>

I have a landscape with a single navmesh covering the entire thing (52000x52000x6000). In the landscape, I have a bunch of enemies with AI which basically run towards the player when in sight range, and attack the player when in attack range. This works great when I have about 30 enemies. I added about 50 more enemies to bring the total to 80, and now only the latest ~30 enemies I added will move - the original 30 just stand there, motionless. If I delete the newly-added enemies, the original ones magically start working again. If I add another 50 enemies (130 total), then they all stop working again except the ~30 most-recently added.

If I walk near the enemies that can’t move, they attack me, so I know the AI is running. I also checked the behavior tree while running and it’s calling the MoveTo node. I’ve been looking everywhere for some kind of information about a maximum number of actors on a single navmesh or something like that, but I can’t find anything that might suggest what’s broken.

edit: after some more testing, it looks like exactly the 50 most recently-added enemys work, and no others do

---

<div class="post-metadata">

**Author:** ![hapro](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hapro](https://forums.unrealengine.com/u/hapro)\
**Post date:** [July 9, 2016, 2:12am UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356/2 "2016-07-09T02:12:54Z")

</div>

Thankfully I’ve found the answer here with some smarter search terms (using the 50 actor limit):

> **[Problem with AI-controller](https://forums.unrealengine.com/showthread.php?94511-Problem-with-AI-controller)**
>
> Hi, please help me with this problem: I have three type of AI’s. Each one is controlled by AI-controller. On Begin Play each AI runs it’s unic Behavior Tree: Everything works fine until there is more than 50 AI’s on the map. In this case, 51-st,...

Quoting from post:

> Problem was in “Max Agents” option in Edit-\>Project settings-\>Crowd manager. Default value is 50. Maybe this information will help someone.

---

<div class="post-metadata">

**Author:** ![AlexanderSt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexanderst/32/465118_2.png) [@AlexanderSt](https://forums.unrealengine.com/u/AlexanderSt)\
**Post date:** [July 31, 2021, 12:46pm UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356/3 "2021-07-31T12:46:23Z")

</div>

maaaaan thank you Very much. You saved me. Thanks.

---

<div class="post-metadata">

**Author:** ![emypippo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@emypippo](https://forums.unrealengine.com/u/emypippo)\
**Post date:** [August 7, 2022, 9:35am UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356/4 "2022-08-07T09:35:20Z")

</div>

ho I can modify the max agents limit?

---

<div class="post-metadata">

**Author:** ![AlexanderSt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexanderst/32/465118_2.png) [@AlexanderSt](https://forums.unrealengine.com/u/AlexanderSt)\
**Post date:** [August 7, 2022, 11:42am UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356/5 "2022-08-07T11:42:05Z")

</div>

in ue5 go to Edit-\>Project Settings here  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/d/51d28ec64e463ac7f68b16a77228cfe24bb28c59.png)  
then on the left sidebar you can find Crowd Manager section

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/b/0bbc9184d5e8d529e5471a627d8ab4e303f35d74.png)

and there is max agents setting on the bottom:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/8/8685e3645376594d7ded24926f9258bee421dbdf.png)

note: this works only if your AiController class is inherited from Detour Crowd Ai Controller  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/c/f6c576634eca6f344bdeff847917931399b724bd.png)

Why this controller is used? It is used to allow pawns avoid each other in combat or on the city streets. It’s limited and has affect on the performance.  
But you anyway will have to hide npc’s that are not in your view or far from the current player position.  
What this limit means? It means that only 50 npc’s can pathfind(move) at one time. It dosen’t mean that there can’t be more than 50 npcs. It can be. But they can’t move together. Only 50 or … the value you set to Max Agents can move at one time.

---

<div class="post-metadata">

**Author:** ![JoShWkdWkdman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joshwkdwkdman/32/935548_2.png) [@JoShWkdWkdman](https://forums.unrealengine.com/u/JoShWkdWkdman)\
**Post date:** [July 30, 2023, 12:15am UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356/6 "2023-07-30T00:15:16Z")

</div>

king

---

<div class="post-metadata">

**Author:** ![Sikhor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sikhor](https://forums.unrealengine.com/u/Sikhor)\
**Post date:** [September 25, 2023, 6:13pm UTC](https://forums.unrealengine.com/t/navmesh-not-working-after-adding-50-actors/363356/7 "2023-09-25T18:13:33Z")

</div>

Man you saved my game… I was searching for 2 months… and now its working… thx
