Quick Calculation

I’ve had this working before, but it doesn’t seem to be reacting with a new project, so suspect I’ve missed a step somewhere.

I’m trying to get the graph to rescan at runtime, but it takes quite a bit of time to calculate (especially when large areas of solid areas are suddenly cleared) when using;

AstarPath.active.Scan();

I did originally seem to use the below, but it doesn’t seem to make a difference in this new project.

Bounds bounds = GetComponent<Collider2D>().bounds;
var guo = new GraphUpdateObject(bounds);

Any suggestion greatly appreciated.

Hi

You need to call AstarPath.active.UpdateGraphs(guo) as well.

1 Like

Oh for goodness sake… thanks - that was easy! :sweat_smile: