Can I set multiple destinations,and calculate the best path?

Can I set multiple desnations(or waypoints),and calculate the best path?

There is a MultiTargetPath method that accepts an array of points and gets a path to the nearest available I believe. Possibly only in Pro version. There is also WaypointPath where you can set way points to follow. I`m currently looking at this option.

Yes, the MultiTargetPath is the correct way to solve this. It is only available in the pro version.
Take a look at the PathTypes example scene to see how it is used.
In the free version you have to request one path for each target and manually check which one is shortest.

thanks all.

I try MultiTargetPathExample.cs,it gave me 2 paths if I set 2 destinations.
like this:

but I need is ONE path pass all the destinations, and must be the best path.
how can I do this ?
thanks a lot !


Unfortunately finding the shortest path which passes through a given set of points is not pathfinding, it is the travelling salesman problem (see Wikipedia) which even though it might seem similar requires very different tools. You can use this system to calculate the sub-paths required to solve that problem however.