Hello,
I was following documentation in order to create turn based strategy in 2D and got idea how to get my tiles highlighted if they are currently walkable, but it seems like function “BlockUntilCalculated()” is not working.
public bool Scan(Vector3 unitPosition, Vector3 tilePosition, int tileSpeed)
{
var path = ABPath.Construct(unitPosition, tilePosition, null);
path.traversalProvider = traversalProvider;
AstarPath.StartPath(path);
path.BlockUntilCalculated();
Debug.Log("Path was found with " + path.vectorPath.Count + " nodes");
int tileDistance = path.vectorPath.Count - 1;
if(tileDistance <= tileSpeed)
{
return true;
}
else
{
return false;
}
}
For some reason my computation time is 0,00ms and because of that I can’t mark properly my walkable tiles. Could someone help or advise me how to highlight all tiles in range of x from path searcher? I can’t afford the pro version, so I’m looking for other solutions.
Edit: I’ve tried to use coroutine but it didn’t help.