AI pathing into corners even with Agent radius set properly
I have a simple AI that needs to path to a random point. It successfully paths to the point however it will get stuck on corners, especially when pathing around a jutting section of wall. My AI is a large ball with a radius of 160.0f. I have set the Agent Radius in Project Settings...->NavigationMesh->Agent Radius to 160. I have also adjusted the movement capabilities of the character movement component of the AI so that the nav agent radius is 160. However, the AI will still get stuck on corners. Bellow is an example of the AI getting stuck:
I am using a custom AI Controller based in C++, however, it is very basic and inherits from the provided AIController. I am also using AI MoveTo to command the AI to move to the random point. Any one know of a solution to fix this issue?
asked Feb 05 '16 at 10:40 AM in Using UE4
It's hard to be sure from just an image, but it looks like for whatever reason your navmesh is just not generating correctly for the given radius. That margin between wall and green navmesh polygons should equal the radius, so that if you position the ball such that it's touching the wall, it should be sat right on the edge of the polygon.
I've found the editor navigation settings a little confusing and settled on ignoring those under NavigationMesh in favour of adding an entry to the Supported Agents section at the bottom of the Navigation System category. Maybe give that a go instead.
Also, I'm not sure if the generation is inherently conservative, or if it's possible that the resolution of the nav mesh could cause these issues sometimes. So it might not be a bad idea to set the supported agent radius slightly larger than the actual radius of your sphere.
answered Feb 05 '16 at 12:33 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here