Agent getting stuck on sloped/higher corners

I’ve been having some trouble tweaking my navmeshes, as I’m having an agent get stuck in a funny way while pathing around with MoveToLocation. I want to keep the parameters of the navmesh as customizable as possible, i.e. allowing for large step heights and max slopes. The problem I’m seeing, however, is that when the agent hits a link in the path on a sloped corner, he steps up and over the location of the current immediate move destination (i.e. that path link destination), and so he jiggles around it for a while until he either steps close enough to the link or paths somewhere else.

I was wondering if there is a way to ignore the Z-height while the agent is pathing when reaching immediate move destinations, or something similar - such as an “Acceptance Radius” for the path links rather than just the goal location. I could fix this by making his max step height lower so he can’t jiggle over (and too far away) from the next move destination, but that makes my navmesh too sparse for gameplay.

Image below to clarify:

Unfortunately the picture is more confusing than clarifying :smiley: Is this what you intended to post? There’s no navigation information on the image.

But I think I know what you mean. Currently the only way to relax Z-axis checks in pathfollowing is with C++. You need to derive a class from UPathFollowingComponent and set MinAgentHalfHeightPct to something more than 1. I’d start with 2 in your case.

Cheers,

–mieszko

Thanks for parsing through my mess of information, Mieszko. That was the answer I was looking for. :slight_smile:

Hmm… I’ve been playing around with the MinAgentHalfHeightPct, and it’s still not working properly for some reason. It seems I may have to work from UE4 source and debug into the HasReached function, eh? :frowning:

EDIT: Now I’m just confused for all sorts of reasons. Now I’m noticing the collision capsule is getting stuck on corners with, as far as I know, correct nav mesh/system settings for my character. The red line in the image below is just a cast from the actor’s position to the current move destination (since segment checks are done with the actor’s feet, this debug visual is wrong, but it gets the point across).