iTween PutOnPathI() question...

Hi developers,

I am using PutOnPath() method of iTween in which I am willing to find what is next WayPoint my character is approaching. Please help me out.

I don’t know of an easy way or an “exact” way. Note I remember reading that the spline that iTween creates is not guaranteeing to pass through any specific waypoint…it may pass near the waypoint instead. One way imprecise way would be to walk the spline (in Start()) in small, discrete steps in parallel with the waypoints. Each time the distance starts increasing, you make a note of the previous position, and then move to the next waypoint. The result will be an array of fractions that are near each waypoint. When the game is run, you can compare your current fraction against the list to see where you are with respect to the waypoints.

Note if you describe the problem you are trying to solve by finding the next waypoint, there may be an alternate approach.