Shortest Path ??

how can i find the shortest path from many paths between first person controller and a specific location (Gizmo) ?

You can use “Vector3.Distance” to find the distance between two objects. I don’t really know what you mean by paths though? Do you mean like different routes you can take?

yes different routes …

Sounds like you want to learn about pathfinding. Unity Pro has it, and a few Unity users have made their own pathfinding plug-ins that work for all versions of Unity.

i have the pro version “Screenhog” but i can’t find pathfinding , where is it ? plz tell me …

It’s new to Unity 3.5. There’s some info here: http://unity3d.com/support/documentation/Manual/Navmesh%20and%20Pathfinding.html

There also used to be a sample pathfinding project available to download from the Unity site, but I’m unable to find it now. Can anyone else help? It was really helpful for learning.

thnx Screenhog i’ll try to get one
now i have 3.4.2 version , dose it have pathfinding plugin , or if theres any way to create a simple pathfinding in this version ?? plz tell me …

3.4.2 does not have built-in pathfinding, you’d need to upgrade (or find a tool on the asset store)

I heard that there is something called “A* Algorithm” , and I tried to understand it but I couldn’t , do u have any useful infos about it ?

The a* algorithm is based on Dijkstra’s algorithm to determine which is the shortest route from A to B.
So to fully understand the a* algorithm you first need to know how dijkstra’s algorithm works. (Which is a pain in the *** by itself…)

But this is really not simple to implement, and I suggest you either use the unity pro 3.5 pathfinding tool or use some other plug-in like A* Pathfinding Project. That project helped me allot to understand pathfinding, and has tutorials with it on how to set it up. Hope it helps you.