IEnumerator crushSpider(float duration = 0.5f) { WallScript.destroyWall(); float bigDelta = 0; yield return(new WaitForSeconds(0.4f)); while (bigDelta < duration) { bigDelta += Time.deltaTime; boot.transform.position = Vector3.Lerp(bootStartPosition, bootEndPosition, bigDelta / duration); boot.transform.eulerAngles = Vector3.Lerp(new Vector3(-bootRotation, 270, 0), new Vector3(0, 270, 0), bigDelta / duration); yield return(null); } gameState = GameStates.dead; }