How to achieve a click to move script?

Mmm it works, thanks, but now if I repeat the code every frame, sometimes the path is not calculated, why happens this?

[code]void Update() {
if ((Input.GetMouseButtonDown((int)mouseButton) || Input.GetMouseButton((int)mouseButton))
&& GUIUtility.hotControl == 0) {

	Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
	RaycastHit hit;

	if (Physics.Raycast(ray, out hit , 100) && lastPosition != ray.GetPoint(hit.distance)) {
			ai.destination = ray.GetPoint(hit.distance);
			ai.SearchPath();
			lastPosition = ai.destination;
		}
	}

}[/code]

P.S: (Solved by read here: Tell AI to immediately find a new path and use it)

And I also take the opportunity to ask, how can I make my “units” not collide with each other?: