Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

AI pathing into corners even with Agent radius set properly

Hi there,

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: alt text

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?

Cheers, Murdo

Product Version: UE 4.10
ai_stuck.png (935.4 kB)
more ▼

asked Feb 05 '16 at 10:40 AM in Using UE4

avatar image

38 3 7 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Feb 05 '16 at 12:33 PM

avatar image

2.1k 83 36 120

avatar image MurdoNZ Feb 06 '16 at 12:12 AM

Hey Kamrann,

Thanks for the answer! I have resolved the issue and the solution was exactly as you say. The Recast-NavMesh was not generating properly. Nor was the AI successfully moving (the action failed due to abort) if I modified the properties of the Recast-NavMesh from the details panel after it had been placed in the level.

The overall fix was to add the correct agent properties to a new entry in the Supported Agents section of Navigation System. As well re-generating the recast nav mesh in the scene via replacing the NavMeshBoundsVolume object. I also had to ensure that, instead of modifying the Movement Capabilities of the Character Movement Component to match the capsule radius/height, the UpdateNavAgentWithOwnersCollision property was checked under the Movement Component section of the CharacterMovementComponent.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question