I set the image type to "Filled". When I move the fill amount slider, it seems to be working properly. I am trying to update it in code: The print statement confirms that the fill amount should be one: However, the progress bar fill amount is zero: Whatever I set the fill amount slider to, I cannot change it while playing the game. What am I doing wrong?
Hey, LumoKvin if you change the "Fill Amount" to 3 before playing the game what does the console read?
I found the problem. When I name the the Image "Progress Bar", it doesn't work. When I name it anything else, it works. That was a hard bug to track down. This must be a bug.
I found the problem. When I name the the Image "Progress Bar", it doesn't work. When I name it anything else, it works. That was a hard bug to track down. This must be a bug.
If that is really a bug, that would be an odd one. Feels like you might have something else going on that is creating an issue.
I think I figured it out. I can name the object anything and it works. When I name it "Progress Bar", it doesn't work. I can even name it "ProgressBar" and it works fine. I don't know why. There has to be something in the code that finds objects by name, which is causing a naming collision.
There is nothing I know of in Unity's code that would have issues with a GameObject name, which is why I suggest it could be something else. Something in custom code that you have or in a package you've installed possibly. The test would be to create a new project, Toss an Image in there and name it Progress Bar and then just add code to update it's fill amount. If it works correctly, then it's not a Unity bug.