AI having problems navigating near corners

HI guys,

I am using Move To Location function for AI navigation. My NPC is a simple triangle for now, in the blueprint AIController code it just finds a Pawn and goes to it location. This happens with certain refresh rate, I tried to call Move To Location every tick, every 0.5 secs, every 2 secs. Problem persists, not depending on that, apparently;

And the problem is - while following me, the bot might get stuck in the corner, facing my location, and slowly sliding towards the right movement direction. After some seconds, it eventually lets him out of the corner and he continues normally moving towards me. This does not happen every time, as you can see in the video, sometimes things work just fine.

What might be the problem? I would like the AI to seamlessly go around the corners, and I am pretty sure it’s more then possible. I have tried changing the collision capsule dimensions of the Bot, but that does not seem to have any effect at all, for some reason. I am using UE 4.1.1.

Here is the video: - YouTube

It looks like your bot radius doesn’t match navmesh generation params. Please adjust generation setup in Edit > Project Settings > Navigation Mesh > Supported Agents [0] : Agent Radius.

This will ensure that navmesh is moved away from colliding geometry and pawn will be able to navigate there.

OK I found the problem. The Bot navigation parameters, such as its size, did not play the role, because they were overridden by RecastNavMesh actor. By manipulating its parameters, I could achieve the desired result with bigger Agent Radius.

They seem like the same parameters that RecastNavMesh has. Is it so that when I put NavMeshBoundsVolume on the map, it spawns the Recast actor with params taken from those project settings?

Yes, it spawns this actor for every supported agent, so you can have multiple navmeshes set up. Usually all enemies share roughly the same collision radius, or there are just two distinct groups (regular mobs + boss types) = it won’t take too much memory for navigation.

Thanks. Now it all works just fine.

Hi again,

After quitting and reopening the editor, I noticed that the agent radius keeps getting reset in the Recast actor to default (35.0). So, when I open the map, the navigation debug shows the right results, but then seconds after that navigation gets reset, with the bad default value 35.0 . In the project settings, Agent radius value remains the same that I left it. I tried deleting and replacing nav mesh bounds, renaming recast actor, starting editor with admin rights - nothing helps. Do you have any idea why that happens and how to fix that? Apparently, UEd does not save the value to the config or map file. I am using 4.1.1.

It’s not the version you’re using. My agent radius is reset every time I reopen my project on 4.3.0 and still with the new 4.3.1 update. Annoying, but I’ve gotten used to changing that setting first thing after opening my project.

Yes, I am on 4.3.0 now and also the same stuff happening. Have you tried using other map? I was thinking of creating a fresh map and setting things up there to see if that’s map-specific, but never got my hands on it yet :frowning:

Not exactly, but I have migrated my project to a clean new blank project to get rid of all the unused starter content. In the process of doing so, I made a couple of meshes to replace the brushes I was using. One of those was the ground mesh. So new blank project, new ground, new navmesh, and still seeing the same setting reset.

Hello, I’m having the same issue. My ai gets stuck going around corners sometimes. Making the Agent Radius bigger stopped the ai from just walking into the wall, but now sometimes they just get stuck, like the Agent Radius is inside the wall and they can’t move, just just give up. I’ve tried finding a balance on the size of the Agent Radius but it’s either run into the wall and slowly slide off it or get completely stuck beside it.

Any suggestions? Thanks!

If you haven’t seen this already, it looks like a related issue was fixed recently for 4.7.

https://answers.unrealengine.com/questions/159346/navmesh-issue-with-corner.html