NavmeshCut with RecastNavmeshModifier for Tags

  • A* version: 5.3.7
  • Unity version: 6000.0.32f1

I am trying to use NavmeshCut alongside RecastNavmeshModifier as described in the Tags/Penalties section.

I have NavmeshCut IsDual set to true.
RecastNavmeshModifier with WalkableSurfaceWithTag using a large box collider.

Using the Graph Coloring debug, I do not see the color change according to the tag being set and pathfinding ignores it.

Anothing thing I noticed is that NavmeshCut IsDual is cutting the navmesh differently. It looks like it misses some edges, which I think will mess up the tagging even if I get it to apply.

Any help would be much appreciated :slight_smile:

Did some digging and found that NavmeshCut.UsedForCut doesn’t ever seem to be called anymore.

I did manage to get something hacky sort of working using NavmeshCut.NotifyUpdated alongside a GraphUpdateScene, but as expected the IsDual edge issue causes the tag application to be problematic.

public class NavMeshTag : NavmeshCut
{
    public GraphUpdateScene graphUpdateScene;

    public override void NotifyUpdated(GridLookup<NavmeshClipper>.Root previousState)
    {
        base.NotifyUpdated(previousState);
        StartCoroutine(WaitAndUpdate());
    }

    private IEnumerator WaitAndUpdate()
    {
        yield return new WaitForSeconds(1);
        //Apply the tag to everything that was cut
        graphUpdateScene.Apply();
        Debug.Log("Applied");
    }
}

*Nevermind, doing it this way causes tagged areas beside each other to be removed. I guess that was to be expected as it was warned in the docs :confused:

I gave in and just added a separate graph for the enemy team so that I can just use NavmeshCut to block one team but not the other. Hopefully it doesn’t cause performance issues :grimacing:

Also tried it on my end-- no success even though I swear I’ve done this exact setup before. I just get this geometry, but with a faint blue outline?

I’ll tag @aron_granberg on this to see if he has any suggestions