private IEnumerator applyPunchForce(Vector2 punchForce) { Vector2 tempPunchForce = punchForce; bool isTempForceLow = false; CamManager.PunchShake(tempPunchForce.magnitude); while (tempPunchForce.magnitude > 0.01f) { velocity += tempPunchForce; tempPunchForce = Vector2.Lerp(tempPunchForce, Vector2.zero, PunchForceDecel); if (!isTempForceLow && tempPunchForce.magnitude < punchForce.magnitude * PunchDisablePerc) { isTempForceLow = true; //if the force goes below 25%, let the character move again. punchForceApplied = false; } else if (!isTempForceLow) { punchForceApplied = true; } yield return(null); } }