• Help
  • Animations lack one frame

I think there is one more issue with spritesheets.
Animations are missing the last one frame from array:
Img 1
Img 2
Video: https://imgur.com/FTmg79f

When I double the last frame to:
Img 3
Then it works

  • It's not really a bug but a behavior of the animations.

    When it reaches the last frame, it plays, but since the animation is finished, it stops immediately.

    The solution is simply to set (in your case)

    { time : 210 }

    to indicate the last time at the end of the animation. This time is in fact the final duration of the animation.

7 days later
5 days later

It's not really a bug but a behavior of the animations.

When it reaches the last frame, it plays, but since the animation is finished, it stops immediately.

The solution is simply to set (in your case)

{ time : 210 }

to indicate the last time at the end of the animation. This time is in fact the final duration of the animation.

    Samarium

    Yes, I have already added this to my spritesheet preset method:

    # ...
    array.push({ time: framesWidth * duration })
    #...

    Result:

        const anim = (direction: Direction, framesWidth: number, duration: number = 5) => {
            const array: any = []
            for (let i = 0; i < framesWidth; i++) {
                array.push({ time: i * duration, frameX: i, frameY: frameY(direction) })
            }
            array.push({ time: framesWidth * duration })
            return array
        }