I want to use Astar component for each prefab


Make each map a prefab,

I want to add an Astar component for each prefab.

Only one map prefab is active.

But I get an error saying there are several “Astars”.

#Error Log
You should NOT have more than one AstarPath component in the scene at any time.
This can cause serious errors since the AstarPath component builds around a singleton pattern.

How can I do it?


Usually you save graphs to files instead. See https://www.arongranberg.com/astar/docs/save-load-graphs.php