After the character passes a level, the map is regenerated, but the navigation does not take effect. You need to manually click AstarPath–>Recast Graph–>Snap bounds to scene
I want to know how to use the API to directly “Snap bounds to scene”…
I am very sorry that I did not find it in the document. I hope you can tell me.
Hi
You do it via
AstarPath.active.data.recastGraph.SnapBoundsToScene();
Thank you very much. I would also like to ask you how to detect whether the “Snap bounds to scene” is successfully completed, so that I can execute it again through the script when it fails.
It is done instantly.
There’s no way for it to fail really. It does what it’s supposed to do.