Detecting when an object is not on the grid?

Hi,

Is there a way to detect if an object is touching the A* grid?

Thank you

You can just do something like:

if (Vector3.Distance(AstarPath.active.GetNearest(Agent.position).node.position, agent.position) < treshold)
{
    //Agent is on graph
}
2 Likes