Odd animation playback with animations from this.anims.createFromAseprite()

When I’ve got an animation with a large difference in frame durations I get very fast playback of the animation.
When they’re the same duration the playback is fine.

Looking into the frame durations I found negative values for some of the durations.

If i had a long frame of 1000 and a short frame of 100 I’d get a frame with -900 duration.

I’ve tracked it down to this line:
phaser/AnimationManager.js#L462
the surrounding code included below:

tempFrames.forEach(function (entry)
    {
        animFrames.push({
        key: key,
        frame: entry.frame,
        duration: (minDuration - entry.duration) // this line
    });
});

If I patch
duration: (minDuration - entry.duration)
to be
duration: (entry.duration - minDuration)

It seems to fix the issue.

Wondering if anyone else has come across this and if its a ‘bug’ or not and if I should file an issue / PR for it if it is one?

2 Likes

Hi, I just came across this same issue. I read the AnimationManager.js code, and it seems that you are right about that code having a bug. But I arrived to a different solution and sent this PR.

1 Like