- Home /
How to do slowly rising bar?
Hi all. I've got a problem with rising lvl bar. My bar doesn't rise slowly. It appears realy fast or it rise but to fast to it's impossible to see it. What I have to do to make it rise slowly? I tried Time.deltaTime and Time.scaleTime and use void Update instead of void Start but it didn't work.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class fiolkaScript : MonoBehaviour {
public Image flk;
float flkshow;
void Update () {
Time.timeScale = 0.2f;
if(PlayerPrefs.HasKey("currentScore")){
flkshow = PlayerPrefs.GetInt("currentScore");
}
Invoke("flkRise",0);
}
void flkRise(){
flk.fillAmount = flkshow /100;
}
}
Comment
Answer by PrisVas · Feb 05, 2015 at 12:48 PM
You could use InvokeRepeating
http://docs.unity3d.com/ScriptReference/MonoBehaviour.InvokeRepeating.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613182515im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Making a bubble level (not a game but work tool) 1 Answer
urgent, pls help. Selection through keyinput in Canvas 2 Answers