Force a scan with A* Pathfinding

Hey all,

I’m using Aron Granberg’s A* pathfinding project with a random maze game, but have hit a problem. As the maze is randomly generated at runtime, the paths change each time. This creates a problem with what I had hoped to use for my AI, as they won’t move if there isn’t a path. I’ve noticed though, if I click the “scan” button in the A* Editor while in play-mode, a path is computed.

Is there a way I can force a scan after my maze is generated?

EDIT: i’m using JavaScript

gameObj is the obstacle you just made appear or dissapear…
enable or disable its collider first then:

AstarPath.active.UpdateGraphs (gameObj.collider.bounds);

also make sure its on the obstacles layer…

You can force a scan in your code. After you’ve generated your geometry for you maze, you can add the following code to force the scan:

AstarPath.active.Scan();