#Stamina bar

1 messages · Page 1 of 1 (latest)

cinder seal
#
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

normal raft
#

Yeah, hold on, lemme re-open unity

#

It does the equation stamina * 0.01f to get Stamina Bar Fill

cinder seal
#

Are u manually setting the values to see what effect this has?

normal raft
#

What do you mean?

cinder seal
#

Where does stamina get its value from

normal raft
#

if (Input.GetKey(KeyCode.LeftShift) && stamina > 0)
{
if (exhausted == false)
{
speed = 7.5f;
stamina = stamina - staminaTotal / 300;
}
else
{
speed = 5f;
stamina = stamina + staminaTotal / 100;
}

cinder seal
#

I would start by just manually setting values in the inspector, then seeing how that looks on your fill bar

normal raft
#

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

cinder seal
#

show the entire script i guess, you probably just arent calling to update the bar, or you have the wrong bar selected

normal raft
#

There

cinder seal
#

when is
```cs
public void UpdateHealthBar()

supposed to run
normal raft
#

Omg

#

Did I not call it

#

Holy shit I'm so dumb

#

Thank you so much