iTween help

Hi all

sorry for the double post, I put the first one in the wrong category on the forum.

How would I replay the same animation in iTween. I need a stop/start sort of movement. Simple, frog crossing a pond, but instead of just going from A to B, I need it to speed up, slow down in time with leg movement.

I can achieve the effect by doing “iTween.MoveAdd(“x”, 5, “time”, 1 etc…” then “Yield WaitForSeconds (1.0);” then “iTween.MoveAdd (again)” Yield again, move again etc…

But is there a way to just loop through that?

Thanks

What about something like this?

using UnityEngine;
using System.Collections;

public class LoopTest : MonoBehaviour
{
	void Start(){
		Move();
	}
	
	void Move(){
		iTween.MoveAdd(gameObject, iTween.Hash("delay", 1, "x",1,"onComplete","Move"));
	}
}

Thanks Pixelplacement

I was being an idiot. All I had to do was put my code in an update function. Sometimes the simplest things are overlooked. But thanks for the reply, I’m sure this method will come in very useful for other purposes.