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>*_