Question by
VictorSoto · May 31, 2018 at 06:10 AM ·
3dfill
How could i create a fill bar which increase with a key press or decrease in function of time?
Hello! Im trying to create a fillbar which increase with a key press. The bar already increases, but i can't make the increase.
Here is my code:
//Bar
public Image bar1;
public bool encendido;
public float Tiempo = 30.0f;
void Update () {
if (encendido == true)
{
bar1.fillAmount -= 1.0f / Tiempo * Time.deltaTime;
}
if (Input.GetKeyDown("F")) {
bar1.fillAmount += 2.0f;
bar1.fillAmount = barraroja.fillAmount;
}
Comment