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.
The variable from the other object called "pointing" is a Vector3 giving an instruction similar to (-.1, 0, 0)
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.
answered Jul 21 '10 at 12:01 AM