A* Pathfinding Project

Pathfinding in completely dynamic scene


In my application I load a fairly complex model consisting of potentially hundreds of individual meshes (using meshcolliders) at runtime. The user is then able to freely move and reorient individual meshes or whole subsets of the model or even stream in additional models dynamically. I would like to have an AI that is able to move within a space containing those models and move out of the way of any repositioned meshes, etc.

Is A* suitable for such a completely dynamic scenario?



That depends on the graph size and how often you need to update it. Grid graphs are the the fastest at updating. If your objects move rarely you can attach the DynamicGridObstacle component to all obstacles and everything will be handled automatically. However if the objects move pretty much all the time you are better off with calling AstarPath.active.ScanAsync regularly to update the graph.