Unity3d progress bar

A.Njuguna picture A.Njuguna · Jul 26, 2015 · Viewed 13.2k times · Source

I am developing a game using unity3D and I need help making a progress time bar such that on collecting particular items time is added and thus the game continues.

Answer

Uri Popov picture Uri Popov · Jul 26, 2015

Create a UI Image that is of type Filled. Use horizontal or vertical fill depending on your progress bar. Then from inside a script you can manipulate the value of the image. I will give you a very simple c# example. For the rest you can just use google and read the unity scripting API.

public class Example: MonoBehaviour {

    public Image progress;

    // Update is called once per frame
    void Update () 
    {
            progress.fillAmount -=  Time.deltaTime;
    }
}