AI Stuck on doors corner

Hi,

Here’s my problem.

My AI is locked when door open.

basically, the door are close, I open them, but since the doors open from inside, the ai get stuck in the edge.

I I run close to the AI (which is programmed to follow me) she will start to follow me and unstuck herself.

Now my question is, why she can’t just go past the door alone?

The code is that, and works perfectly in every other situation.

thx

I think this a bug as this also happens with other move functions such as SimpleMoveTo.

I would suggest putting it as a bug report for the version of the game you have.

I didn’t found out a way to show the navmesh in runtime.

But if the door is set to movable, shouldn’t the navmesh recalculate when she is moved?

Did you take a look at your nav mesh?

If your door opened but the nav mesh didn’t update the bot thinks it can walk that way and just runs against the door. Since you have no mechanic to check if he’s stuck it will just do that forever.

Use show navigation to show navmesh at runtime.

I believe navmesh is by default configured for off-line generations. Have you changed navmesh generation properties so that it builds at runtime?

No. The nav mesh is exactly what you built when pressing “Build”. When you drop out of your character you can display it as usual (I think the hotkey was P?).

Anyway. You can change that via a setting (which is quite expensive resource why which is why the default setting is not that behavior).

It’s under Project Settings → Engine → Nav Mesh → Runtime → Rebuild at Runtime.

Enable that and it will update during runtime when changes occur.

I have a problem which is related to this. I managed to make the navmesh generate through doorways. However, when I close the door, the navmesh isn’t able to be generated through doorways which is good but if I close the door while an AI is passing the doorway. The AI could get stuck at a place with no navmesh. Any idea I get solve this problem? Thanks a lot.

The most simple solution would probably be to have the AI open the door again (or reopen the door if it collides with a pawn).

Alternatively there are nav links which can be used to show the AI where it can move from one navmesh to another (like jumping or moving through a closed door).

I’m not 100% sure how the link would play with a mid movement change (as in closing the door after the AI has already passed the link). But in the worst case you can just have the AI move through once it’s set the door state to open. Regardless whether the door stays open.

What is more likely happening is a door is not modifying navmesh. You open/close door, but have you updated navmesh? Press P to see it. More likely navmesh is static. The way to fix it is to set navmesh to be realtime dynamic and make sure that that door has “Can ever affect navigation” is ticked.

Thank you for your reply. I agree on the simple solution and my another idea would be making the door detect if an AI is passing through it to decide whether it can be closed or not.