Skip to content

Regression in 3.88. Animation frame duration ignored and frameRate fixed at 24 #7070

@sylvainpolletvillard

Description

@sylvainpolletvillard

Version

  • Phaser Version: 3.88
  • Operating system: Windows
  • Browser: Chrome latest

Description

Since 3.88, my animations are all running at 24 FPS despite having no frameRate set. The duration in the framearray is ignored.

This is a direct regression of this change: a8f921b

When no frameRate is passed in animation config, it defaults to 24 FPS:

target.frameRate = 24;

So state.msPerFrame || state.currentFrame.duration will never check currentFrame.duration because msPerFrame is set to 1000/24

Example Test Code

const durationArray = [10,20,30,40]
const frameArray = this.game.anims.generateFrameNames("test", { start: 0, end: durationArray.length - 1 })
for (let i = 0; i < durationArray.length; i++) {
   frameArray[i]["duration"] =  durationArray[i]
}
this.game.anims.create({ key: "test", frames: frameArray })
sprite.anims.play({ key: "test" }) // will run at 24 FPS, ignore durationArray

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions