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.