Objects move towards graph when outside of it

Hi, I made a player with a grid graph that follows him. I have objects with AIPath that represent animals, and I noticed that when they are outside the graph, they navigate towards it. Is there a way to check whether they are inside the graph, and if not, not to move them?

Hi

This is easiest in the beta version. Then you could do something like:

void Update () {
    var graph = AstarPath.active.graphs[0];
    ai.enabled = graph.bounds.Contains(ai.position);
}

In the non-beta, the bounds property doesn’t exist.