When using the latest version of the beta 4.3.84 in a web GL build, I get a bunch of errors in the web console that says “Cannot tick non-multithreaded pathfinding when no coroutine has been started”. This never appears in the editor.
When reproducing this issue I created a new project and just built Example3_Recast_Navmesh1, the agent was still able to navigate but the error kept getting thrown. However, in my project, where I first noticed this issue, my agents could not navigate. I believe fixing this issue fixes my agent’s navigation issue too.
If there’s anything else I can provide, I’ll be happy to!
Thanks! A fix will be included in the next beta update.
The code was relying on ManualResetEvents in one case, which are not functional at all in WebGL.
Awesome, thank you! Any idea when the next beta version might be released? I really want to try my game in WebGL and this is a real show stopper right now.
Hi, I still have that problem, which completely breaks my game. I have updated a*pp to version 5.1.6. Still the same. Is there a workaround that I can use to prevent this error?
Unfortunately not. My game is several gigabytes in size. But it happens when I open a door and set nodes to walkable or activate NodeLinks and then scan in WebGL. In x64 everything works as intended. My Unity version is 2022.3.40f1.
Following Error appears. The interesting thing is: It doesnt happen everytime. It seems to happen after 4 or 5 times quite consistently. So I thought it might have to do with the number of jobs in astar. But no matter how many jobs I setup, its always the same outcome:
IndexOutOfRangeException: Index was outside the bounds of the array.
Pathfinding.GlobalNodeStorage.GetNode (System.UInt32 nodeIndex) (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/GlobalNodeStorage.cs:57)
Pathfinding.PathHandler.GetNode (System.UInt32 nodeIndex) (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/PathHandler.cs:278)
Pathfinding.Path.CalculateStep (System.Int64 targetTick) (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/Path.cs:1077)
Pathfinding.Path.Pathfinding.IPathInternals.CalculateStep (System.Int64 targetTick) (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/Path.cs:1131)
Pathfinding.PathProcessor+<CalculatePaths>d__36.MoveNext () (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/PathProcessor.cs:461)
Pathfinding.PathProcessor.TickNonMultithreaded () (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/PathProcessor.cs:216)
UnityEngine.Debug:LogException(Exception)
Pathfinding.PathProcessor:TickNonMultithreaded() (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/PathProcessor.cs:221)
AstarPath:Update() (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/AstarPath.cs:891)
Unhandled exception during pathfinding. Terminating.
UnityEngine.Debug:LogError (object)
Pathfinding.PathProcessor:TickNonMultithreaded () (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/PathProcessor.cs:222)
AstarPath:Update () (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/AstarPath.cs:891)
InvalidOperationException: Cannot tick non-multithreaded pathfinding when no coroutine has been started
Pathfinding.PathProcessor.TickNonMultithreaded () (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/Pathfinding/PathProcessor.cs:213)
AstarPath.Update () (at ./Library/PackageCache/com.arongranberg.astar@5.1.6/Core/AstarPath.cs:891)
Maybe the jobs/coroutines are not cleared up automatically after they finished in webgl?
It was from data.OnEnable();
I don’t use cache in my project, so i returned early from the OnEnable function and it works fine for me. Please keep me updated once you have a proper fix
Would you mind making a new thread for this one with a link to this thread? I’m hesitant to continue the thread here due to it’s age and I wouldn’t want OP/other participants getting notifications from it.