instructing waypoints

I am attempting to get an object to receive "heading" instructions from waypoints.

Here is the code I have written, however it does not work as I would anticipate I.E. doesn't make any apparent difference in the object's movement direction.

var movement = Vector3(.1, 0, 0);
private var waypoints : GameObject[] = GameObject.FindGameObjectsWithTag("WayPoint");
function Update () {
    transform.Translate(movement);
    for (var i = 0; i < waypoints.length; i++)
    {
        if (Vector3.Distance(transform.position, waypoints*.transform.position) < 1)*
 *{*
 _var pointingDirection = waypoints*.GetComponent(PointDirection);*_
 _*movement = pointingDirection.pointing;*_
 _*}*_
 _*}*_
_*}*_
_*```*_
_*<p>The variable from the other object called "pointing" is a Vector3 giving an instruction similar to (-.1, 0, 0)</p>*_
_*<p>Thanks</p>*_

From your code you've posted, every update you'll loop through every waypoint in the array, there's nothing that says which way point is the current heading.

What you need to do is remove the loop and add a current waypoint variable and increment the current way point when you pass the distance check.

There's a simple waypoint system in Gotow's car tutorial, just scroll down to it.

http://www.gotow.net/andrew/blog/?page_id=78