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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Sprite Animation Loop not smooth

Discussion in '2D' started by Predule, Apr 6, 2020.

  1. Predule

    Predule

    Joined:
    Mar 30, 2020
    Posts:
    5
    Hello, I wanted to ask your help with one png loop. I made 22 png that when in loop make and endless background moving effect, the thing is ,every post I searched for says to fix that working around the curves of the animation..but when I hit the curves button I don't have any. part 1.png part2.png
    There is any other way to make the loop go smooth without using curves ?
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @Predule

    Curves in 3D software define usually transform change, scaling, rotational or positional change of 3d objects or some values.

    But if you are using sprites, there is no curve for swapping from sprite a to sprite b AFAIK.

    So could you define what you mean by smooth? Maybe you have wrong assumptions about how sprites work or is it something else perhaps.

    If your sprite animation looks choppy, maybe add more frames, although it will take more memory.

    There is nothing else to sprite animation, it is basically flipbook / frame by frame animation.

    If you were to animate just one frame moving from right to left (for example) then you would have a curve.
     
  3. Predule

    Predule

    Joined:
    Mar 30, 2020
    Posts:
    5
    @eses My bad, didn't explain it properly, when I said smooth I was talking about the end of the animation looping again to the start. Between the frames inside the 1-22 it goes really well, but when it does the 22 -> 1 jump it do a weird "break" that let you see clearly the end of each loop. So I was wondering if there was any way to deal with that (for now I'm just doing everything else in the game with one static color background lol)
     
    stuepfnick likes this.
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @Predule

    I don't think there is anything strange. But without seeing a video can't say for sure.

    Maybe you have duplication of end and start frame, or a non seamless loop.

    Either way these show very easily, especially if animation is otherwise smooth.
     
  5. stuepfnick

    stuepfnick

    Joined:
    Apr 19, 2017
    Posts:
    18
    @Predule: I know what you mean, did you find a proper solution? If I have a 4 frame animation (for simplicity) and place Image1 to Frame0, I2 to F10, Im3 to Fr30 and Im4 to F40 - it plays nice, but jumps in one frame from 40 to 0. I cannot extend it to 49 frames (empty 9) or let it start at frame 10.
    So my solution now is to duplicate last frame and set it to 40 and 49. But was hoping for a "nicer" way, like set first sprite frame at 10 and still at 0, which does not seem to be possible, or at least I couldn't find out yet.
    And Loop Pose, Cycle Offset does not seem to help (or do anything in 2D?)
     
    Gozum likes this.