Hello, I’m trying to create a script which decreases health dependant on whether Thirst or hunger are 0. It works fine, when either thirst or hunger = 0.
I’m trying to make this health degredation quicker if both are 0, as can be seen in my last “else if” statement, but never does anything. Is there another way I could write this set of statements?
/*DAMAGE HEALTH IF HUNGER OR FOOD IS ZERO*/
if(currentThirst <= 0)
{
currentHealth -= Time.deltaTime / 4;
}
else if(currentHunger <= 0)
{
currentHealth -= Time.deltaTime / 4;
}
else if(currentHunger <= 0 && (currentThirst <= 0))
{
currentHealth -= Time.deltaTime * 10;
Debug.Log("SPEED UP!");
}