iTween PointOnPath

Hi guys,

I’m trying to get the 3d position along an iTween path however when I use the PointOnPath function its returning huge irrelevant numbers far outside the world im editing e.g.-5.597703E+08 but if i put a box on the spline and move it using the MoveTo func it moves correctly along the spline and I can get a proper position out of it.

Am I using the function incorrectly? I assume percentage actually means 0.0f is the start of the path and 100.0f the end.

Heres my code:

Update()
{
     var mPathPercentage:float = 0.0f;
     var tempPoint :Vector3 = iTween.PointOnPath(iTween.GetPath("racingSpline"), mPathPercentage);
     Debug.Log(tempPoint.z);
     mPathPercentage+= 0.05f;
}

anybody got any ideas? thanks for any help!
Gringo

Percentage must be provided in 0-1 range so you would like to divide your percentage by 100.

Update()
{
     var mPathPercentage:float = 0.0f;
     var tempPoint :Vector3 = iTween.PointOnPath(iTween.GetPath("racingSpline"), mPathPercentage/100);
     Debug.Log(tempPoint.z);
     mPathPercentage+= 0.05f;
}

Update is called every frame. PointOnPath accepts a percentage value between 0 and 1. your mPathPercentage variable reaches 1 pretty much immediately after you start.