- Home /
iTween.MoveTo distance along path
I have the following code:
iTween.MoveTo(gameObject, iTween.Hash("path", pathN, "speed", speed, "orienttopath", true, "easetype", iTween.EaseType.linear, "oncomplete", "clearPath"));
No problems here, and I am overall very impressed with iTween. However, I need to get my object's %age distance along the path each frame. The end reason for this is that I am creating a line/ path drawing game (Flight-Control-esque), and I need the line (Which I am using a LineRenderer for) to dissapear behind the object as it moves along. Does anyone know how to do this? I keep thinking I'm missing something in iTween's docs.
I'm not aware of a method that returns your path percentage inside of iTween, but I could also be missing something in the documentation. You may want to try using the "onupdate" callback to create your own function to calculate your position along the path and convert that into a percentage.
Your answer
Follow this Question
Related Questions
Having problem with itween.moveto and oreinttopath 0 Answers
iTween movetopath 1 Answer
iTween syntax error? orienttopath with moveto 1 Answer
Go back to first node (itween + moveto) 2 Answers
itween moveto not working 1 Answer