Calculating paths in editor (while game isn't running)

Is there a way to calculate paths while the game isn’t running? I’ve made a sort of “patrol path” editor for the Inspector that allows me to add a sequence of waypoints, and I want to draw paths between the waypoints in the Scene View so that I can see the full path that my units would be following. But I can’t figure out how to calculate the paths between the waypoints without the game actually running. When I try, I get an error that says something along the lines of, “There are no graphs in the scene.”


While in theory this is possible. The system is assuming the game is running. You can try to do it by simulating a running game by calling the Awake and Update methods on the AstarPath component, but I am not sure if it will work.


I know this is a relatively old post, but I was wondering if you have this feature on your roadmap at all? I made some adjustments in your code to get it working but it would be much nicer to have this built in. This way I wouldn’t need to for changes in those parts every time there is an update to your project.


No, it is not on the roadmap at the moment.
However if you have already made those changes, maybe you could point me to a diff or something and I might be able to merge it in.

Sorry for the late reply. The changes weren’t huge and also a bit hacky, I have to admit.
Mainly I removed some #if UNITY_EDITOR and #endif lines and called the AstarPath’s Awake and Update methods where needed (for my use cases)