Search Unity

Question 2D Animation appears too big on one frame

Discussion in 'Animation' started by CorentinPB, May 16, 2021.

  1. CorentinPB

    CorentinPB

    Joined:
    Jul 14, 2017
    Posts:
    3
    Hello,

    I have a weird issue with my animations in 2D (Unity 2020.2.1f1). I use an animator to change a sprite and resize the sprite renderer during an animation. To resize the sprite, I'm using the sliced draw mode of the sprite renderer. Here's a screen of the animation setup :



    It works well, except there are some glitches in the animation during one frame (I think it's at the beginning of the animation) that make the sprite appears too big. In my animation, I'm not changing the size of the sprite during the animation, it's constant (I know I can remove the keyframes for the size). It's hard to catch it in a recording as it's only one frame, but it look like this :



    Instead of this :



    I don't know if it's linked or not but I can "trigger" the issue with the preview mode in the editor (not in runtime). If I go from frame 14 to 15 and then go back to 14, the sprite appears too big like the problem I have in runtime. Here's a video of what I'm talking about :



    Do you know what exactly is happening here ? Is there a way to fix this ?

    Thank you,
    CorentinPB
     

    Attached Files:

    Last edited: May 16, 2021