Recast graph loses penalty after NavmeshCut



My recast graph loses its penalties applied through an GraphUpdateScene after an object cuts into the graph. What would be the correct way to re-apply the penalties after a cut.
I found the OnEnableCallback on the NavmeshClipper however this is a private event.



Yes, unfortunately there is no way to keep penalties after a navmesh cut as the graph can have changed in arbitrary ways.

I would recommend that you use tags (because applying a tag multiple times to the same region is ok, in contrast to penalties which will accumulate). To get an event when graph updates are done you can make a script inherit from the GraphModifier class, and then override the OnGraphsPostUpdate method.

class MyType : GraphModifier {
    public override void OnGraphsPostUpdate () {



Reapplying the tags in OnGraphsPostUpdate invoke OnGraphsPostUpdate causing an infinite loop.


Oh, right… I suppose you could call ( as IUpdateableGraph).UpdateArea(guo) directly, that will not cause the callback to be called. And since you are only updating penalties it should be fine.