Support Forum

[Free Version] Scan on runtime doesn't carve objects with colliders

Hi! I’m making a “build your city” game, so I need to rebuild the graph everytime a new building is appended to the scene. Each Building is a prefab with its own colliders but whenever I try to rebuild with:

AstarPath.active.Scan(); or AstarPath.actives.Scan(pathFinder.graphs[0]);

It rebuilds the graph (I can see the logs stating the building time) but it doesn’t carve empty space around the new buildings.

Although if I Push Scan on the button on the Scene View, it works correctly and carves the graph around the buildings as expected.

I’m using a grid graph.

Am I missing something? Thanks

Hi

That’s odd. Are you sure all objects are properly initialized when you call AstarPath.active.Scan()? What happens if you delay scanning by 1 frame?