Update a specific node by coordinates?

I can’t seem to find a way to update a grid except by the graph update script. I’m making a turn-based games, which tend to only have objects occupying a single node. If I had a unit in 1,0,4 world space I know that it’s on node 1,4. How would I set that node to not able to be traversed?

The easiest is to do something like this:

`
GraphUpdateObject ob = new GraphUpdateObject(new Bounds (transform.position, Vector3.one*0.1f));
ob.modifyWalkability = true; // Do modify walkability
ob.setWalkability = false; // Set walkable to false

AstarPath.active.UpdateGraphs (op);
`

Basically, create a bounds object which has a bounds only slightly extending outside that coordinate.

You can also do it directly like this:
Vector3 pos = transform.position; AstarPath.active.AddWorkItem(new AstarPath.AstarWorkItem (delegate (bool force) { AstarPath.active.GetNearest(pos).node.walkable = false; // This line will make sure a flood fill is done // it recalculates connected components (google) in the graph AstarPath.active.QueueWorkItemFloodFill(); return true; }));
The above assumes using the latest beta version.
If not using the beta version:
AstarPath.active.GetNearest(transform.position).node.walkable = false;
This /looks/ simpler, but the problem is that it is not safe. Path calculation can get odd when the graphs are updated at the same time as paths are calculated on them.

Note: No code above was checked for compile errors, so there might be small errors in them.