Canceled path error with Multitargetpath

I have a script that I modified slightly from the multitargetpath example that runs infrequently, but I am constantly getting an error that says “Canceled path because a new one was requested,” sometimes on the first time the multitargetpath function is triggered. I have listed my code below, is there something I’m missing?

Thanks for your help!

void Start() {
	seeker = GetComponent<Seeker>();
}

public void StartMultiPathing() {
       // get endpoints
	count = currArrayVectors.arrayList.Count;
	Vector3[] endPoints = new Vector3[count];
	k = 0;
	foreach(Vector3 _vect in currArrayVectors.arrayList) {
		endPoints[k] = _vect;
		k++;
	}

	if (!started) {
		seeker.pathCallback = OnPathComplete;
		started = true;
	}

	seeker.StartMultiTargetPath(StartingPoint, endPoints, true);
}


public void OnPathComplete(Path p) {
	if (p.error) {
		Debug.Log ("No path"); 
		return;
	}

	MultiTargetPath mp = p as MultiTargetPath;
	if (mp==null) {
		Debug.Log ("No multi path target reached"); 
	}

	if (rp == null) rp = new RichPath();
	rp.Initialize (seeker, mp, true, funnelSimplification);

	List<Vector3>[] paths = mp.vectorPaths;

	count = paths.Length;
           
	for (int i=0; i<paths.Length; i++) {
		List<Vector3> path = paths[i];
		if (path == null) {
			Debug.Log("path not found");
			continue;
		}
		// stuff
	}
    }
}

Hi

If the seeker is not done with the current path it was calculating (which might be another type of path), it will cancel the previous path and start with the new one. I assume you are using the Seeker for other things as well, not just the multi target paths?

Thanks for getting back to me! I’m just using the seeker for this, so I know it’s not doing anything else. I understand what the error means, but I’m confused because I’ll get it upon triggering a new path even though the previous path was completely calculated and did the PathComplete callback, so I know that the path did finish calculating and there shouldn’t be a reason to cancel it. It seems like an error that should happen if you’re calculating paths constantly, but I let a few minutes pass between each calculation and still get it.

Hi

Sorry for the late answer.
It really should not be triggered if the path has already been calculated. Try enabling the path log (A* Inspector -> Settings -> Path Log Mode) and see if you are not starting a path twice by mistake.