iTween: change parameters during the path

Hello People

I’m using the itween moveto function to move a gameobject along a path. Now i want the gameobject to go faster between point 3 and 5. Can i change the speed parameters during the path? Or is there any other way to do this?

Thanks in advance for your help!

One way is to use PutOnPath() or PointOnPath() to place the game object on the path. The last parameter of these two methods is the percent of the way through the path to place the object/point. To use these, you’ll have to write code that increments the percentage at at some rate. You can increase the percentage faster between points 3 and 5. Untested example code. Assume your points 3 and 5 are at .47 and .65 of the way along the path:

float fFraction = 0.0f;
float fFastRatePerSecond = 0.2f;
float fSlowRatePerSecond = 0.1f;

void Update()
   if (fFraction >= .47 && fFraction <= .65)
      fFraction += fFastRatePerSecond * Time.deltaTime;
      fFraction += fSlowRatePerSecond * Time.deltaTime;

    iTween.PutOnPath(myGameObject, path fFraction);