iTween OnComplete question.

Hey, so…I’m looking around, and I’m not understanding exactly how to call a function once an iTween is finished.

I want a box to increase in scale and then shrink to Vector3.zero…here’s my code currently. Do I need a hashtable for this? I’m not “getting it” yet.

Cheers,

Simon

if(shrink)
	{
		iTween.ScaleTo(thisplacard, Vector3(1.25, 1.25, 0), .125, "onComplete", "ShrinkDown");
		if(thisplacard.transform.localScale == Vector3.zero)
		{
			if(Random.value > .5) blinkout = Instantiate (blinkparticle2, thisplacard.transform.position,  Quaternion.identity);
			else blinkout = Instantiate (blinkparticle, thisplacard.transform.position,  Quaternion.identity);
			Destroy(thisplacard);
		}
	}

//THEN....

function ShrinkDown()
{
	iTween.ScaleTo(thisplacard, Vector3.zero, .25);
}

I’m not sure, since you’re using javascript, but in C# you definitely need a hashtable to use oncomplete- there are only two overrides for iTween.ScaleTo, one accepts a gameObject, vector3, and float (for time), and the other accepts a gameobject, and a hashtable.