Beta - WebGL throws errors about not being able to tick pathfinding

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!

1 Like

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. :slight_smile:

Probably some time this week.

1 Like

We are also very much waiting for this error to be fixed

I’m facing the same error, i hope the next update with a fix will be released soon

Hi

Sorry, some refactoring is taking longer than expected. But I’m working as hard as I can to get it out quickly.

1 Like

The new beta is available now! Sorry for taking so long.

3 Likes

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?

I’m using a game object based point graph.

Hi

Do you have a test project with which I could replicate this issue reliably?

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.

                if (_pathfindingNode.graphNode != null)
                {
                    _pathfindingNode.graphNode.Walkable = true;
                    _pathfindingNode.graphNode.GetConnections(con => con.Walkable = true);
                }```

            if (AstarPath.active != null && !AstarPath.active.isScanning)
                AstarPath.active.Scan();

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?

I put in a completely new setup pathfinding component. Now it seems to work.

Hello,

I’m using Pathfinding 5.3.3 and I still have this problem (everything works fine on windows and editor)


I’m using GridGraph instead of recast graph but I think this does not change much about the problem…


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 :slight_smile:

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.