Shrinking an object to Vector3.zero

Hey, folks! Thanks for your help.

I’ve been playing around with Vector3.Lerp, but I don’t understand why what I’m trying isn’t working. Basically, I’ve got a cube whose scale is (1,1,.1), and the code I’ve got here isn’t working. Any advice or code examples? Thanks a bunch!

if(shrink)
{
	if (t < 1.0) 
	{
		t += shrinkspeed;
		transform.localScale = Vector3.Lerp(Vector3.zero,startingScale, t);
	}
}

What you have will lerp the scale from Vector3.zero to startingScale… as t moves from 0.0 to 1.0.

http://unity3d.com/support/documentation/ScriptReference/Vector3.Lerp.html

personally I just use iTween for this sort of thing. iTween.ScaleTo(gameObject, Vector3.zero, time);

done like dinner.