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.
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.