So I have set up a 3D navigation system where a small group of NPCs wander around a space using a Navmesh. NPCs are NavigationAgents, the player has a NavigationObstacle (now working, thank you 3.5.2). Pathfinding works, and avoidance works well, as long as NPCs are moving. However, as soon as an NPC finishes navigation and becomes static, he gets ignored by all other agent's avoidance, and they get stuck.
I tried to come up with a workaround:
- When an NPC finishes navigation, a disabled collision shape on them is enabled
- Navmesh is re-baked for the new collision shape to punch a "hole" in it
- Pathfinding updated, other agents are now avoiding static NPC, due to being outside Navmesh
- When NPC is set to start wandering again, the collision shape is disabled again, Navmesh re-baked and the "hole" fixed
It "works" but as you can imagine, it's pretty janky and not very efficient.
Anyone got any ideas as to how better deal with a situation like this?