Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Image fill amount jerking.

Discussion in 'Unity UI & TextMesh Pro' started by Tojen, Dec 13, 2017.

  1. Tojen

    Tojen

    Joined:
    Apr 15, 2017
    Posts:
    6
    Hello. I have a picture of type Filled and I need to smoothly change its's "Fill Amount" for a certain period of time. I tried to do this through the code, and then through the animation. The problem is that in both cases in the editor window everything works smoothly, but in the Game window it jerks. What is the problem?
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,715
    Can't be sure, but if you post the code you used to change it, perhaps someone can offer some feedback :)
     
  3. Tojen

    Tojen

    Joined:
    Apr 15, 2017
    Posts:
    6
    void Update()
    {
    _currentTime -= Time.deltaTime;
    _fuelFill.fillAmount = _currentTime / _startTime;
    }

    but the problem is not in the code, since when I start the animation, the jerking remains
     
  4. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,715
    Hmm, ok.. well 1 other thought on the matter. Does the animation (or code) for this fill change happen right when you hit play? Sometimes there is a laggy start in the editor for a small bit , and I was wondering if maybe it was that.
    If it doesn't start right away, then I'm not sure what is wrong, sorry.
     
  5. Tojen

    Tojen

    Joined:
    Apr 15, 2017
    Posts:
    6
    No, it works for the duration of the game
     
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    4,763
    check in the build with profiler, if anything there causing lag?
    or maybe different quality settings in editor vs build?
     
  7. YD_JMysior

    YD_JMysior

    Joined:
    Aug 4, 2016
    Posts:
    14
    I'm having the exact same issue. The fill value is incremented every Update() call with very small values and yet in Play mode the Image animation is not smooth. It's perfectly smooth when the fill value is changed in Edit mode. Did you manage to sort it out?
     
  8. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    192
    same here any possible fix for this? im using Update() too and I have 10 of it..like in adventure capitalist
     
  9. Nucky9

    Nucky9

    Joined:
    Apr 8, 2016
    Posts:
    9
    I am also having this problem. The fill is smooth in the scene view, but choppy in the game.
     
  10. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    316
    Likely your canvas is not rebuilding when it should, possibly because the framerate is so high the delta is too low? Try forcing the rebuild in your update, but longer term be aware of the cost that will incur.