Agent radius never works for my ai in 4.11

Its been hell the past 2 days trying to figure out what i am doing wrong regarding changing the agent radius of my large “monster” . I am just trying to make my monster not run into walls and not getting stuck into simple corners . The attached screenshot gives a clearer idea .

I tried modifying all sorts of checkbox and sliders in the capsulecomponent , movementcomponent and even in the project settings creating supported agents .

Changing the agent radius in the movement component never does anything . Changing the agent radius in the supported agents through the project settings will only work when the value is between 30 to 40 .

Inputting any value less than 30 or greater than 40 will no longer make the ai follow the path and just goes towards (0,0,0) vector position instead of my target player . So it apparently breaks the path if the agent radius in the supported agents is below 30 or above 40 . I need some help badly on this matter , any help and inputs regarding this problem will be great .

I have the exact same problem

an i’m too(

I am also having troubles with this, it seems to be a bug in unreal 4, if seen multiple posts all saying the same thing. if anyone has an answer for this would be grateful

I got this to work finally!

I think Unreal tries to automatically choose navmesh based on character radius and other parameters.
It could be that when the radius difference get’s too large it won’t select the navmesh. You could probably fix it by setting the right parameters everywhere but i did not get it to work.

Instead i did “Get All Actors Of Class” and searched for the right RecastNavMesh.

I used the name it was given in the world outliner to identify which RecastNavMesh to use. (would be better to use something else as ID probably, the name changes sometimes)

231443-worldoutliner.png

Then i used it with the pathfinding.

In Project Settings->NavigationSystem i created Agents for my different Characters with the Height and Radius i wanted.

Keep in mind that it’s only the first navmesh that will automaticaly be visible when pressing ‘p’. To view the other navmeshes you need to select the other RecastNavMeshes in the world outliner and click ‘Enable Drawing’. They will also not be visible in play mode when using the command ‘show Navigation’. You need to click enable drawing on them again while in play mode to show them.

This could probably be fixed by creating a child class of RecastNavMesh and set ‘Enable Drawing’ to ‘True’ in it. You can also create an ID in the child class to be used with the “Get All Actors Of Class” function.
Remember to select the new class to use for each Agent, in Project Settings->NavigationSystem (Image 4).
‘Navigation Data Class’ and ‘Preferred Nav Data’ should be your new child class (i’m not sure if both are needed, but just to be safe change both)

Underrated answer, it concisely lists and describes all the problems that will trip anyone starting out fiddling with AI and navmeshes (such as myself). None of the workarounds is readily discoverable without instructions. Even a tooltip change to notify users that the world outliner recast navmesh properties are broken (or at least not supposed to be edited at all) would help in that regard immensely.

Googling around today (2019) took me to at least 15 different questions / pages without the correct reasoning with entries between 2015 and 2018. The only way I found this question / answer was by googling “ue4 navmesh agent radius 30 39” which only happened because I already had spent time bisecting the set of valid values. It is just sad to imagine that many people will waste time rediscovering the same problem details while this answer doesn’t bubble up in the google results.

Additional data in case anyone is curious about investigating how the world outliner recast navmesh properties are broken (tested in 4.19.2):

  • Changes in the agent height property for the recast navmesh are applied ONLY AFTER you update the cell size property (values tested were 18, 19, 20 for cell size). This seems to apply only for the agent height property, since changes to the agent radius property is applied regardless of the cell size being updated or not.
  • If you change the agent height to 139 or lower, or 149 or higher, the recast navmesh stops working (needs a cell size update to take effect). 139.1 and 148.9 agent height work just fine even after updating cell size.

Maybe it’s just my impression, but it seems some parts of the recast navmesh are only partially reconstructed depending on which properties you change. This would make sense since it would save a lot of time depending on context. But it really messes usability since the user has no way of knowing beforehand which of his chosen changed values are even taking effect or not.

The really specific ranges of 30 < agent radius < 40 and 139 < agent height < 149 suggest many of these range values are hardcoded somewhere. Again, this messes usability since the user would have no way to find out these problematic values without doing lots of unnecessary bisections.

Mieszko already acknowledged that the world outliner recast navmesh properties are broken and should not be edited (at least in regards to agent radius) in a post in one of these related questions. But the usability problems could be easily solved by simply pointing the user to the project settings section via tooltips or warnings… or even greying out the world outliner properties and not allowing them to be editted. Would save lots of user time while a fix doesn’t happen.

Google says this is relevant to the point that it was the very first hit so here it goes:
There is a navigation mesh setting above navigation system within project settings. There you have to set up the limitations for the agents. This is valid for all, like min size, max height etc. - so if you don’t fit into this, your agent is ignored.
So create agents AND change limits.

Tbh.I still don’t think this is all that good as I have noticed that if a character’s radius is changed in game, the agent radius does not get affected? But if I make a new class that has the capsule resized that works. Maybe I should try exposing the agent settings of the character in c++ though for now I made it work like this:
Made the agents, changed the limitations and created 1 pretty much empty character class for each agent that aligns with that agent perfectly. Gravity 0.
I spawn them from gamestate below the map very far, hide them, store their references in gamestate.
Whenever I need pathfinding I call up gamestate, I get the character closest to what I need with a function and use that as a pathfinding context instead of the actual character.
Do I think this is how it should work? Hell no. But it is easy.

You can also try directly searching for the recastnavmesh, it has your agent’s name in its object name, but if you have multiple navmeshes covering different parts of your map you need to search which has your character inside it so, not to mention I’m not sure they don’t get new references when rebuilt so storing them might not work perfectly.

So far it appears all of this is still true on higher versions as well.