So i have an attack timer working similar to an hp bar
when an attack is called it counts down from a IEnumerator that calls a waitforseconds and the seconds are equal to the attackspeed
as far as i understand a Coroutine in this case counts down from the current value to 0
i need the fill of my bar to display the value of attackspeed as it is being counted down if possible
the update function looks like this at the moment im not sure whats missing
void updateattacktimer()
{
float fillamount = attackspeed/100;
if (fillamount != attacktimer.fillAmount)
{
attacktimer.fillAmount = Mathf.Lerp(attacktimer.fillAmount, attackspeed, Time.deltaTime * lerpspeed);
}
}