hi, i’m using the fill amount to change the health bar state, the value of decreasing depends on the weapon, i store the damage value in a variable called “value” and from another script i do this :
public void SetValue(float value)
{
maskblue.fillAmount -= value;
}
the fill amount doesn’t change and stay 1, but if i change " value" by a float number ( 1f, 0.5f ) it works !
notice that in the other script i call the previous function “SetValue” like this :
public void ChangeHealth( float amount )
{
currentHealth += amount;
HealthBar.instance.SetValue(amount);
}
where the value of " amount" depends on the weapon’s bullet ( -0.1 , -0.2 …) i only did the -0.1 for no so…
I hope someone can help me! thank you.