hit.collider is presumably the tilemap collider. There are no colliders for individual tiles.
ok thank you for your help. Ill have another go at trying to update a smaller part of the grid.
I fixed it and it works super fast now. Here is the code i used for others that might be stuck:
if (mainTilemap.GetTile(lPos) != null)
{
Vector3 min = transform.position + transform.up * digRange * 2 + transform.right * digRange * 2;
Vector3 max = transform.position -transform.up * digRange * 2 + -transform.right * digRange * 2;
cellBounds.SetMinMax(min, max);
//update graph
cellBounds.Expand(Vector3.forward * 100);
var guo = new GraphUpdateObject(cellBounds);
mainTilemap.SetTile(lPos, null);
// change some settings on the object
AstarPath.active.UpdateGraphs(guo);
1 Like