NullReferenceException on AstarPath.active.Scan

Hi, I get this NullReferenceException error when ever I try to scan the level during runtime after I have restarted Unity. It works fine if when I add the AstarPath but as soon as I restart the “connection” is lost. I’m using APP Pro V3.5.2 and Unity Pro 4.5.5

Oh an while I’m at it. Is there a way to change the size and center of the recast graph bounding box during runtime? I’m working a procedural script and I want the size of the level to be somewhat player specified so I dont know the exact size and center of the level beforehand.

Thanks

Hi

Are you trying to do it in Awake?
The AstarPath component might not be initialized in Awake, and thus the AstarPath.active static variable might not be configured.

Try to do it in Start instead.

Yeah, you can get the first recast graph defined using
var graph = AstarPath.active.astarData.recastGraph

Yeah you where right, works just fine now :slight_smile:
Ah thanks! I looked around in AstarData but never found it.

Thanks for the quick help!

Yeah you where right, works just fine now :slight_smile:
Ah thanks. I looked around in AstarData but never found it.
Thanks for the quick answer!