NavMesh agent size changes at runtime

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

Project Settings

When CanAffectNavigation is disabled the NavMesh is built fine:

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

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!

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:

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 :slight_smile:

Updated to 4.7.2, the issue persists

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.

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

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.

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.

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.