# NavMesh agent size changes at runtime

**URL:** <https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611>\
**Category:** World Creation\
**Tags:** bug, Navigation, navmesh-bug, unreal-engine, navmesh, question\
**Created:** [March 12, 2015, 6:52am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611 "2015-03-12T06:52:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fervensmiber](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fervensmiber](https://forums.unrealengine.com/u/Fervensmiber)\
**Post date:** [March 12, 2015, 6:52am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/1 "2015-03-12T06:52:56Z")

</div>

Branch: Binary

Build version: 4.7.0-2455222

I’m having strange behaviour with NavMesh. When I enable bCanAffectNavigation on Pawn in runtime, the rebuilded NavMesh uses default agent size instead of what is set in RecastNavMesh-Default actor or in Project settings.  
This is happening in my main game project but I made a small repro project to demonstrate the issue.

Here are my NavMesh settings:  
RecastNavMesh-Default actor

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/0/50f1853dfa3b10e82ad07625ababc14292888d42.png)

Project Settings

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/2/d2ab7e13931e89b5a569aaae6c3b4b13a5746b4a.png)

When CanAffectNavigation is disabled the NavMesh is built fine:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/3/d35bf40f267b3a375005d656523c8623826890ea.png)

After enabling CanAffectNavigation the newly generated NavMesh is using wrong agent size

[![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/7/d70c924af46a5e560edca3c08b07e062fed165be.png) ](https://i.gyazo.com/11de8942d1ee72b980eeace051a6b6e5.png)

Here’s link to a simple repro project: [link text][5]

Repro Steps

1. Open the repro project
2. Press Play to start the game
3. Click on the Character
4. The CanAffectNavigation is enabled and rebuilt NavMesh is using wrong agent size for the tile the Character is in

I’m happy to provide more info if necessary.  
Thanks for looking into this!

---

<div class="post-metadata">

**Author:** ![omigamedev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@omigamedev](https://forums.unrealengine.com/u/omigamedev)\
**Post date:** [March 12, 2015, 7:40am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/2 "2015-03-12T07:40:39Z")

</div>

For me is just working fine. I’m using 4.7.2. Maybe you just need to update, or something is just wrong with your project. Hope this helps 🙂

 ![33783-cattura.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/7/ef7e2b7a6693bb231a9a39f721ecbc301afa9b40.jpeg)

---

<div class="post-metadata">

**Author:** ![Fervensmiber](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fervensmiber](https://forums.unrealengine.com/u/Fervensmiber)\
**Post date:** [March 12, 2015, 7:52am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/3 "2015-03-12T07:52:41Z")

</div>

Updated to 4.7.2, the issue persists

---

<div class="post-metadata">

**Author:** ![Fervensmiber](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fervensmiber](https://forums.unrealengine.com/u/Fervensmiber)\
**Post date:** [March 12, 2015, 8:08am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/4 "2015-03-12T08:08:04Z")

</div>

Thanks for trying it out. In 4.7.2 the behaviour is still bugged. In editor the NavMesh is cast correctly but if you hit play and click on the character the navmesh tile with the char in it is recast with wrong agent size.

---

<div class="post-metadata">

**Author:** ![TatuTeittinen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TatuTeittinen](https://forums.unrealengine.com/u/TatuTeittinen)\
**Post date:** [March 12, 2015, 8:10am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/5 "2015-03-12T08:10:53Z")

</div>

I can confirm it still exists in 4.7.2 and is quite troublesome. And as Fervensimber it works in the editor until you actually play it and the recast bugged:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/4/d4a7425210e09f5fbac007534a694f2a7b75a7df.jpeg) ](https://abload.de/img/keisip4ueq.jpg)

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [March 16, 2015, 8:14pm UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/6 "2015-03-16T20:14:41Z")

</div>

Hi Fervensmiber,

Thank you for the report. I was able to reproduce the issue and have submitted JIRA UE-11956. Our developers will be investigating the issue further and we will post here with updates as we get them.

Cheers,

TJ

---

<div class="post-metadata">

**Author:** ![TorQueMoD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/torquemod/32/710746_2.png) [@TorQueMoD](https://forums.unrealengine.com/u/TorQueMoD)\
**Post date:** [March 16, 2024, 11:53pm UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/7 "2024-03-16T23:53:33Z")

</div>

Not only does it change if you update at runtime, it also changes if you update it period.

I’m not updating the navmesh at runtime, and I set the Agent Radius in my Project Settings to be 200, but after closing the project and reopening, The radius did not update. I then manually set the Agent Radius in the RecastNavMesh-Default actor in the world outliner, and this DID update the value, however, upon restarting the project, the values were reset back to the defaults.

> [@UE 5.3 - Navmesh Agent Radius Won't Update](https://forums.unrealengine.com/t/ue-5-3-navmesh-agent-radius-wont-update/1755767):
>
> So I’ve tried to adjust the Navmesh Agent Radius to make sure my AI isn’t getting stuck on walls, but it doesn’t do anything. I did a search and an old post said to restart the project or rebuild the navigation, but neither of those worked. Can I edit this in the DefaultEngine.ini or something?

This issue is happening in UE 5.3 - I’m going to submit a new report since I just realized this thread is 9 years old.

---

<div class="post-metadata">

**Author:** ![TorQueMoD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/torquemod/32/710746_2.png) [@TorQueMoD](https://forums.unrealengine.com/u/TorQueMoD)\
**Post date:** [March 17, 2024, 2:04am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/8 "2024-03-17T02:04:50Z")

</div>

If anyone else runs into this issue, I was able to solve it by creating my own Agent in the Supported Agents list. I simply clicked on the + and set my agent radius there and gave it an agent name of Custom. Then I deleted the RecastNavMesh - Default actor, and built the paths again. This caused a new RecastNavMesh - Custom actor to be added to the level, and I’ve tested that restarting the project keeps my custom data. Frustrating to say the least, but at least there’s a workaround.

---

<div class="post-metadata">

**Author:** ![day1ks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@day1ks](https://forums.unrealengine.com/u/day1ks)\
**Post date:** [April 22, 2024, 9:23pm UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/9 "2024-04-22T21:23:51Z")

</div>

For those who are going to try this solution, I ended up finding a bug, if you create a new agent it seems that the pawns that were already at the level will ignore the new navmesh. Deleting them and putting them back in solves the problem. This does not happen with pawns that are created at runtime

---

<div class="post-metadata">

**Author:** ![TorQueMoD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/torquemod/32/710746_2.png) [@TorQueMoD](https://forums.unrealengine.com/u/TorQueMoD)\
**Post date:** [April 30, 2024, 3:02am UTC](https://forums.unrealengine.com/t/navmesh-agent-size-changes-at-runtime/310611/10 "2024-04-30T03:02:06Z")

</div>

Interesting and good to know. Though I really recommend you use the Player Start and actually spawn your pawn rather than possessing one you drop in the level anyway. It’s the proper way to do this. If you’re wanting to be able to switch pawns to things like vehicles etc., I even suggest using a dummy actor that you can interact with and then removing it and replacing it with a spawned pawn at runtime.
