Search Unity

Unity Animation smooth in preview but stutters in editor

Discussion in 'General Graphics' started by DualDub, Oct 11, 2017.

  1. DualDub

    DualDub

    Joined:
    Oct 11, 2017
    Posts:
    3
    0favorite


    I have created an animation in unity. (2017.1.2f1) This animation is actually on an Image not on a SpriteRender, so it's hooked on Image.Sprite. The animation is made of 10 images.

    The animation runs smoothly in the preview window but when played in the editor (or an Android device), it kind of "stutters". That is it plays for a couple of seconds, stops a second, play another couple, stops, etc...

    Can something kindly help ?

    Thanks

     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    I'm no 2D expert - but this probably has something to do with the 10 image frames, the 12 animation samples and the framerate the game is playing at. It's like playing a 29.97 video at 30 fps - eventually there will be a dropped frame that looks odd - every 28th second or so - not doing the math right now - just guessing, and video will eventually fall out of sync with the time and audio.
     
  3. DualDub

    DualDub

    Joined:
    Oct 11, 2017
    Posts:
    3
    There is no audio.
    The animation works fine in preview.
    The stuttering is happening only in the editor. Every 2 seconds or though.

    Thanks for beeing the only one suggesting something though.
     
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    I was just using an example of 29.97 playback at 30 fps, same thing happens.

    Does it make sense the stutter happens every 2 seconds when the animation is only 10 frames and the animation sample settings (in the image above) are set to 12?