Hi any idea why my fill amount on the image is not changing? the text updates fine and goes down 99,98 ect ect but the fill amount stays fixed
public float Hunger;
public float MaxHunger = 1f;
public float Thirst;
public float MaxThirst = 1f;
public Text Hungertxt;
public Text Thirsttxt;
public Text Healthtxt;
public Text Staminatxt;
public Image HungerImg;
public Image ThirstImg;
void Update()
{
Hungertxt.text = Hunger.ToString()+ "%";
HungerImg.fillAmount = Hunger;
Thirsttxt.text = Thirst.ToString()+ "%";
ThirstImg.fillAmount = Thirst;
Staminatxt.text = currentExhaustion.ToString()+"%";
}
void Start()
{
InvokeRepeating("LowerHunger", 10f, 10f);
InvokeRepeating("LowerThirst", 5f, 5f);
Hunger = MaxHunger;
Thirst = MaxThirst;
}
void LowerHunger()
{
Hunger = Hunger - 1;
if (Hunger <= 0F)
{
Hunger = 0F;
InvokeRepeating("LowerHealth", 1f, 1f);
}
}
void LowerThirst()
{
Thirst = Thirst - 1;
if (Thirst <= 0F)
{
Thirst = 0F;
InvokeRepeating("LowerHealth", 1f, 1f);
}
}