AI keeps trying to path over an obstacle it can't step over

If you watch the video here, it shows what is happening: UE4 AI Nav Mesh (sort of) problem with a (sort of) fix - YouTube

Given a low(ish) obstacle that the AI is unable to step over, it keeps trying to path across it to reach the player, rather than path around it

Solutions:

  1. Make the obstacle taller (that would ruin level design)
  2. Use a NavModifier to block out the NavMesh on the obstacle (a lot of effort, plus it would stop any enemy at all from being able to walk ontop of the obstacle - perhaps it’s a ledge some other enemies can reach)

The navmesh shows there is no path from the floor to the top of the obstacle but it still tries to path across it, a screenshot of the nav mesh is: https://puu.sh/rWDg3/ad2d23589c.jpg

I’ve also tried playing with the step height property to no avail

Any ideas how to fix this without the NavModifier solution would be great

Cheers,
Alex

It seems your navmesh agent radius size is too small. It needs to match (or be bigger than) AI agent’s collision radius. Otherwise (like seen on the video) AI will run into obstacles because navmesh tells them they should be able to fit.

Cheers,

–mieszko

That sounds like it’ll work, I’ll give it a try after work

Cheers! :slight_smile:

So I’ve done some testing, no matter what I set the AI’s capsule radius to, if I set the Agent Radius in the Recast Nav Mesh to anything higher than 14, the AI fails to move. I’ve tried changing the Agent Radius in the Project Settings as well but that doesn’t seem to make a difference

You need to set the radius in Project Settings->NavigationSystem->Supported Agents. If it’s empty then add an entry and configure your agent there.

Would this radius overwrite the Agent Radius property of the Recast Nav Mesh? And should it be set to the same as the AI’s capsule collider (or is it independent)?

So I did a lot of playing around with what you suggested and now it seems to work! I documented what I did in case it’s of any use to anyone else

http://programminginadarkroom.blogspot.co.uk/2016/10/ue4-ai-navigation-issues-i-think-hope.html

Thank you! :smiley:

Can you show me how you did it :smiley: