- Home /
Increase fill amount isnt working
Hello
At first I just instantiate a canvas which contain that progress image
When I put this in the update nothing happens, my function is called every frame but the fill amount is stuck at 0
using UnityEngine.UI;
public Image boostBar;
public Canvas boostBarCanvas;
private void IncreaseBarUi()
{
//if(isBoostAvailaible == false)
// {
boostBar.fillAmount += 0.01f * Time.deltaTime;
print("BoostInc");
// }
}
Answer by dev-waqas · Jan 16, 2018 at 05:46 PM
Check the Image Type is correctly setup. 
or you might have TimeScale = 0 which you can reset by using.
Time.timeScale = 1;
You might be referencing the prefab and not the instantiated gameobject.
I've finally got it throught, thanks :] GameObject boostBarObject = GameObject.FindGameObjectWithTag("boostUI"); boostBarCanvas = boostBarObject.GetComponent(); boostBarCanvas.enabled = true;
Your answer
Follow this Question
Related Questions
Finding a panel in canvas 2 Answers
Scrolling, repeating canvas image 0 Answers
enable a canvas on trigger 2 Answers
Custom Transparency Axis Canvas Rendering Order 0 Answers
How to make UI/canvas displayed trough gameobject/world-space-canvas 1 Answer