Dynamic restricted area (NavMeshGraph)

I use NavMeshGraph.

I have a situation like this:

When “AI 2” starts to cast AoE ability, I want to make this area (orange color) unwalkable for “AI 1” (but still walkable for “AI 2”), so “AI 1” will escape from it to a walkable area (green color).

As you maybe can see, AoE is not a simple circle - it is a “CirclePie” (with 270 degrees filled, and 90 is not).

QUESTION: Does my only solution is “NavMeshCutting”, where I will need to dynamicly create Mesh through Unity?

P.S. Game will have multiple AoE abilities using “CirclePie”, some of them will have 270 degrees, some 90, 45, etc. - that’s why I can’t just create a single mesh in Blender and reuse it for any possible AoE ability.

Bump. Does someone how any ideas?

Hi

I’m afraid this is not that easy, especially with a navmesh graph. Furthermore, agents typically don’t like having the ground below them made completely unwalkable. Instead I would recommend that if an agent detects that it is inside an AoE, you try to find the closest point on the boundary of that aoe (without pathfinding) and move towards that point.

1 Like

Thank you for your response.

I would recommend that if an agent detects that it is inside an AoE, you try to find the closest point on the boundary of that aoe (without pathfinding)

Wow, that’s a some complex stuff. I was hoping there is some functional to evade dynamic areas is out of the box.

I’m afraid this is not that easy, especially with a navmesh graph

Can you please tell me if there is something simillar to what I request is possible with another graph type? Maybe “Recast” graph?