#Stamina bar
1 messages · Page 1 of 1 (latest)
public void UpdateHealthBar()
{
staminaBarImage.fillAmount = staminaBarFill;
}
}
What values are u using when u say "it doesnt scale with the value its supposed to"? Can you show this
Yeah, hold on, lemme re-open unity
It does the equation stamina * 0.01f to get Stamina Bar Fill
Are u manually setting the values to see what effect this has?
What do you mean?
Where does stamina get its value from
if (Input.GetKey(KeyCode.LeftShift) && stamina > 0)
{
if (exhausted == false)
{
speed = 7.5f;
stamina = stamina - staminaTotal / 300;
}
else
{
speed = 5f;
stamina = stamina + staminaTotal / 100;
}
I would start by just manually setting values in the inspector, then seeing how that looks on your fill bar
Nono, the fill bar doesn't change at all
That's the issue
All the variables work as intended
It's the fill bar that is causing the issue
show the entire script i guess, you probably just arent calling to update the bar, or you have the wrong bar selected
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
There
when is
```cs
public void UpdateHealthBar()
supposed to run