Many "Path Failed" errors - but everything seems to work

I see a lot (hundreds over a few minutes of game time) of these errors:

Path Failed : Computation Time 0.00 ms Searched Nodes 0
Error: Canceled by script (Seeker.CancelCurrentPathRequest)
Path Number 990 (unique id)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogWarning (object)
AstarPath:LogPathResults (Pathfinding.Path)
AstarPath:<InitializePathProcessor>b__122_1 (Pathfinding.Path)
Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler)
Pathfinding.PathProcessor/<>c__DisplayClass24_0:<.ctor>b__0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()

However, I cannot see anything wrong with the NPCs that are using A* - the path Gizmos show they all have paths, they all move, everything seems just fine except for these errors.

I have the following A* components on my NPCs:

  • Seeker
  • AIPath
  • Simple Smooth
  • Funnel
  • Alternative Path

Is the problem with my selection of components? How can I get more information about what is causing this issue?

Hi

It looks like you might be calling ai.SearchPath manually quite often? Calling SearchPath while a path is being calculated will cancel the currently ongoing path request and start a new one.

I’m not setting it very often, but there does seem to be a relation there. I’ve added some debug output and it looks like the error indeed shows up after SearchPath() calls. I’ll be digging into that and figure out what’s going on. I think it happens when I enable a previously inactive GameObject and start the path on it. Maybe it starts it twice or something.

1 Like