Simple move to, getting stuck on corners

My ai gets stuck going around corners sometimes. Making the Agent Radius bigger stopped the ai from just walking into the wall, but now sometimes they just get stuck, like the Agent Radius is inside the wall and they can’t move, just just give up. I’ve tried finding a balance on the size of the Agent Radius but it’s either run into the wall and slowly slide off it or get completely stuck beside it.

Btw, I’m using “Simple Move to Actor”.

Any suggestions? Thanks!

I replied to another question but no reasons there. AI having problems navigating near corners - AI - Unreal Engine Forums

Would you mind posting some images with navmesh debug-drawing enabled?

Maybe have the actual actor detect when it’s not moving?

Like… if it gets stuck, it’s movement velocity will be slowed considerably… so maybe set up a bool for when that happens, and have the thing that’s moving “move to” a location that’s behind it (subtract or add from that location to make a new one), and then resume it’s path?

Just a thought! :slight_smile:

Not a bad idea, although I’d like to do it without running more checks.

I’ll post images/video asap(probably this weekend).

Check like that is already being done under the hood of AI pathfollowing. This sounds like navmesh setup issue that’s why I’d like to see some images.

What’s the command line for navmesh debug-drawing?

First one is 200, the other is 300 Agent Radius.

It seems your problem is connected to the fact that your characters punch holes in the navmesh. Do you have a real reason for having this feature enabled? I’m asking because this is a bit of a hack, character avoidance should be handled by either RVO or detour crowds. The only good reason to have this enabled is to have paths generated around characters that are not moving, and this can be still achieved with dynamically toggling whether a character affects navmesh (so that it doesn’t update navmesh while moving). If you enable navmesh drawing while your character is moving you’ll see what I’m talking about.

Having said that we have something in the pipeline that will make it work both better and faster. It should be available in version 4.8.

Cheers,

–mieszko

Sorry, that guy is just a statue, a static mesh. He’s not the character that gets moved around.

The only thing I’ve changed in the navmesh setting is the Agent Radius.

What about AI agents, what’s their radius?

I’m not using AI(I probably should I suppose). Only using default pawns being moved with “Simple Move to Actor”.

So you are using elements of AI :smiley: The agent radius in this case would be what defined by your pawn movement component’s properties.

I see, those settings are at default. I’ll play with them and see if I get better results. Should they be set the same as the navmesh? What’s standard practice for that?

I’ve seemed to have found a balance of 100 Radius in the navmesh and 150 on the ai. Haven’t been able to get it stuck or sliding on a wall yet. Thanks!

Ideally Navmesh would be build to agent radius equal or greater to radius of your characters.

It may be worth checking the settings of the characters EMovementMode.

Switching from the default MOVE_Walking to MOVE_NavWalking greatly improveded the movement for us.

auto cm = GetCharacterMovement();
cm->SetMovementMode(EMovementMode::MOVE_NavWalking);

1 Like

Wow this solved a ton of issues for us, thanks!