IEnumerator resetBool() { while (true) { if (hittingPlayerThisFrame) { yield return(new WaitForSecondsRealtime(0.1f)); hittingPlayerThisFrame = false; PlayerRun.speedUp(); } yield return(new WaitForEndOfFrame()); } }