Search Unity

[SOLVED]UI Image Animation vs Sprite Animation

Discussion in 'UGUI & TextMesh Pro' started by BTStone, Jun 10, 2016.

  1. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey folks.

    So since the Unity UI is basically based on the same 2D system I thought to use it for animating the UI Images the same way I do when animating sprites - with the Animator/Mecanim.

    Now the interesting thing is that there is apparently a difference and I don't know exactly why and it would be great if you guys could point out the mistake I made, since I strongly believe that it's just a tiny setting-mistake.

    Here's the deal:

    - I have a simple Sprite with a Sprite-Renderer and an Animator with a AnimatorController which has different AnimationClips, one of these Clips animates the Sprite-Component and cycles trough the Sprites. The very same applies to my Images which is animated. It has the UI Image Component and an Animator with the very same AnimatorController and a Clip animating the Image and cycling through the very same Images as the other Clip which animates the Sprites.

    The result looks like this:

    1) Sprite Animation



    2) Image Animation




    For some reason the Image-Animation "jumps" while the Sprite-Animation is completely static. And I'm not animating any position in the Image-Animation-Clip, this is just how it looks.
    I already ticked "Preserve Aspect" in the Image-Component, so this is what it looks like (it looked worse without the checkbox ticked)

    Any ideas what is happening?
     
  2. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Woops, guess I figured it out - my PivotPoint was set to 0.5/0.5 , reset itto 1/1 solved the issue apparently.
     
    SimonDarksideJ likes this.
  3. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Yes Pivots and Anchors, whilst powerful, can trip up the best of us :D