public IEnumerator IdleEnum() { float timeElapsed = 0f; float waitTime = 2f; while (humanoid.statusText.text == "Harvesting") { timeElapsed += Time.deltaTime; if (timeElapsed >= waitTime) { Debug.Log("ran harvest enum"); humanoid.AddToInventory(1); timeElapsed = 0f; } yield return(null); } }