Seeker.StartMultiTargetPath() inconsistent path error

I have 1 seeker in my scene which I use to do all pathfinding. Here I call Seeker.StartMultiTargetPath() with the starting position of one Token and an array of the positions of the enemy tokens. I only need the shortest path, and provide a callback.

private void GetPathToClosestEnemyThenMove()
    {
        var targets = Managers.TokenManager.GetTokensThatAreNotOnTeam(_tokenController.TeamType)
            .Where(x => x.isCharacter).Select(x => x.transform.position).ToArray();

        Debug.Log($"lesser start pos: {transform.position}");
        foreach (var target in targets)
        {
            Debug.Log($"target position: {target}");
        }
        Managers.CardGameManager.Seeker.StartMultiTargetPath(transform.position, targets, false, DoAttack);
    }

This results in some of the paths returning correctly but seemingly randomly some of the paths give an error that it “Couldn’t find a valid node close to the any of the end points”. Which is odd, because it must have found nodes close to the given end points if the previous path finding attempts worked. None of the target positions changed between pathfinding attempts.

Is this some internal bug? It seems to work some times but not others and the end points do not change.

Hi

I’m not sure what’s going on there.
Try to debug all the start/destination positions using e.g. Debug.DrawLine class to make sure they are all correct.

Are you using pathfinding tags for anything?

I have not used pathfinding tags yet. I just ran it again and this time only 2 path finding attempts errored while only 1 worked. The one that worked did show a proper looking debug line between it’s start and end position.

After doing a fresh rerun and setting one of the token to the starting point which worked in the previous screen shot attempting to run the path again resulted in an error this time:
image

I replaced the MultiTargetPath() with the standard StartPath() providing just one of the target positions and it always works. Is it possible something is wrong under the hood in StartMultiTargetPath() ?

This works just fine with the same start position and a single target position:

Managers.CardGameManager.Seeker.StartPath(transform.position, targets[0], DoAttack);