private IEnumerator DropoffSugarAni(GameObject dropoffPoint) { Vector3 saveScale = sugarInBackpack[0].transform.localScale; GameObject sugar = sugarInBackpack[0]; sugarInBackpack.Remove(sugarInBackpack[0]); sugar.transform.localScale = Vector3.zero; sugar.transform.parent = null; player.DropoffSugar(); sugar.SetActive(true); Debug.Log(dropoffPoint.transform.position); while (sugar.transform.position != dropoffPoint.transform.position) { sugar.transform.localScale = Vector3.MoveTowards(sugar.transform.localScale, saveScale, sugarPickupSpeed); sugar.transform.position = Vector3.MoveTowards(sugar.transform.position, dropoffPoint.transform.position, sugarPickupSpeed); yield return(null); } sugar.SetActive(false); sugar.transform.localScale = saveScale; yield return(new WaitForSeconds(dropoffDelay)); if (sugarInBackpack.Count > 0 && runDropoffAni) { StartCoroutine(DropoffSugarAni(dropoffPoint)); } }