How to make iTween.PutOnPath restarts the path again and again?

( I’m new to this)
I’m working on an endless runner game with 3 lanes, iTween.PutOnPath helps me to make the player follow the path and to switch between lanes, however It doesn’t start over the path ( which is something crucial in my game).

  • I’ve tried using a trigger at the end of the path and once it triggered, call the function again at the first path point but it didn’t work
  • I’ve used iTween.MoveTo , but it doesn’t switch between lanes correctly.
  • is there a way where I can make put on path start over the path once it is finished or perhaps a combination of putonpath and moveto?

Just use iTween.PutOnPath(gameObject, path, PathPercent);

PathPercent = 0.0f for begin and 1f for end. Use PathPercent += 0.01f * Time.DeltaTime;

You can make a simple loop doing this:

if(PathPercent >= 1)
{
  PathPercent = 0;
}

You can find more information on this topic: http://answers.unity3d.com/questions/408334/itween-path-swap.html