Using Constant Path Type

Hi I have 3 Questions regarding Constant Path

  1. In the documentation it says

//Here you create a new path and set how far it should search. Null is for the callback, but the seeker will handle that
ConstantPath cpath = new ConstantPath(transform.position,2000,null);
//Set the seeker to search for the path (where mySeeker is a variable referencing a Seeker component)
mySeeker.StartPath (cpath,myCallbackFunction);

Do I still need the myCallbackFunction if I am using the seeker? If so what does this function contain? Could it be just replaced with OnPathComplete?

  1. And can constant path be used in navmeshes to have the same result?

  2. I am making a strategy game wherein I want my characters to surround the target and attack them. If I would use constant path for it would I need to compute the gScore myself to make the my characters surround the enemy target, or would the seeker automatically compute it for me so that if a there are other characters in a particular destinationNode the player would choose another node for its destinationNode.

anyone?

Hi

Sorry, had started writing an answer, but apparently I never posted it.

Yes you need to. Otherwise you won’t know when the path has been calculated. The path complete method is usually named OnPathComplete, so yes, you can replace it with that.

  1. Navmeshes do not encode distances very well, so while you can use ConstantPath on navmeshes, it will not give you very accurate results.

  2. I think you should not use constant path for that, instead send your characters to some offset from the target, for example in a circle around it. That will be a lot faster ( which is very relevant for a strategy game which usually has lots of units ).