GraphUpdateObject doesn't work on Recast graph

So I’ve checked this post and tried to implement same thing.
Just to check if everything if fine - I’ve tried to check if “Apply” method is called for “NoPath”-class which is descendant of “GraphUpdateObject”-class.

public class NoPath : MonoBehaviour
{
    private void Start()
    {
        var guo = new NoPathGraphUpdateObject();
        guo.bounds = GetComponent<Collider>().bounds;
        AstarPath.active.UpdateGraphs(guo);
    }
}
public class NoPathGraphUpdateObject : GraphUpdateObject
{
    public override void Apply(GraphNode node)
    {
        Debug.Log("NoPathGraphUpdateObject Apply()");
    }
}

MAIN PROBLEM: When I try to use it with “RecastGraph”, “Apply” method is never called.

However, everything works fine and “Debug.Log()”-message is displayed, when I try to use it with “GridGraph” or “NavMeshGraph”.

I’ve checked where “Apply” method is called and it looks like there is indeed no calls from Recast-related classes (at least it looks like this):

That’s how huge “Box Collider” is (it’s half way in the ground):

A*-GameObject Inspector:

So what reason might that “Apply()”-method is not called, when I use Recast graph?

Hi

The recast graph will only call ‘Apply’ if the updatePhysics field is false. For this use case you definitely want updatePhysics to be false anyway for performance.

1 Like

The recast graph will only call ‘Apply’ if the updatePhysics field is false. For this use case you definitely want updatePhysics to be false anyway for performance.

Indeed. Now everything works fine, thank you!