IEnumerator shrink(float time, Edible toShrink) { isShrink = true; Vector3 originalScale = toShrink.transform.localScale; Vector3 destinationScale = new Vector3(0.1f,0.1f,0.1f); float currentTime = 0.0f; do { toShrink.transform.localScale = Vector3.Lerp(originalScale, destinationScale, currentTime / time); currentTime += Time.deltaTime; yield return null; } while (currentTime <= time); isShrink = false; toShrink.UseUp(originalScale); }