Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Image fading with Slider breaks at 0 - is it by design or a bug?

Discussion in 'UGUI & TextMesh Pro' started by the_motionblur, Aug 23, 2014.

  1. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Since it's been available I've been playing with the new UI in my free time and so far it' really cool.
    The flexibility and ease of use already seem very cool.

    I've noticed an odd behaviour with the slider in conjunction with the image fill amount.
    I was wondering if this is by design or if it's a bug. I set up a slider so that it controls the fill of an image (you'll see in the webplayer). When I set the slider range from 0.001 to 1 the slider works as expected: decreasing and increasing the fill amount of the image. When I set the slider to the full range, though the image fill does not increase after it's reached absolute zero any more.

    Scene 1:
    https://dl.dropboxusercontent.com/u/63380367/Unity/UI_slider_1/UI_slider_1.html

    Scene 2:
    https://dl.dropboxusercontent.com/u/63380367/Unity/UI_Slider_2/UI_Slider_2.html

    I thought I'd ask right away if this is normal behaviour (and may occur in other similar cases as well) or if this should not be happening. :)
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,181
    Hi, we have fixed this issue already but it didn't make it into this release. It should be in the next beta drop.
     
    the_motionblur likes this.
  3. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Allright - thanks! :)
     
  4. Bren

    Bren

    Joined:
    Aug 28, 2008
    Posts:
    191
  5. taylormg

    taylormg

    Joined:
    Jan 15, 2015
    Posts:
    1
    I am still seeing this issue as well, though it occasionally even happens with values that are not zero. Repeatedly setting the value in an Update() loop in a script eventually gets the value to stick.

    I have to wonder, is this related to similar UI variable value bugs? For example the Shadow and Outline effects not having their values stick either? With animating them a user's suggestion of calling SetAllDirty() works with the shadow and outline, but it hasn't yet worked for fillAmount.
     
  6. viktoria_h

    viktoria_h

    Joined:
    Jan 11, 2018
    Posts:
    1
    Here we are in 2019 using unity 2018.3.3f1 and this issue is still an issue.
    adding this line image.enabled = image.fillAmount > 0; after the one where you set your image.fillAmount = 0f; in Update() loop fixes the issue.
     
  7. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Still having the issue using unity 2019.2.0f1...