// Update is called once per frame void Update() { if (canLoseStamina) { if (currentStamina > 0) { currentStamina -= StaminaDecayRate * Time.deltaTime; } else { villageManager.GoToSleep(transform.position, true); } } }