Finding original target

Hi there,

I am using the StartMultiTargetPath function in A*PP Pro to fetch the single closest path from a variety of gameobjects. I’m looking for a way to recover the original “end destination” value from the resultant path call, so I can mark the object at that position as being tended-to in the code (and skip it for subsequent unit calls). Something like:

Debug.Log(p.originalEndPoint);

I poked a bit at the code and could see vestiges of this kind of functionality, but nothing publicly facing. Is there a way to do this that I’m just not seeing?

Hi

There is a chosenTarget integer exposed. That will tell you the index of the target which was the closest. If you really want to get the actual coordinate, use
mypath.targetPoints[mypath.chosenTarget]
Since that is using floating points, I would recommend using the index, otherwise you might fall into floating point hell.

See http://arongranberg.com/astar/docs_FeatureFreeze/class_pathfinding_1_1_multi_target_path.php#ad94377b095e3bde630fa2c63ecf17cfd