Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sylvainpolletvillard opened this issue Mar 2, 2025 · 3 comments

Comments

@sylvainpolletvillard
Copy link
Contributor

sylvainpolletvillard commented Mar 2, 2025

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

@VonAncken
Copy link

I can confirm the problem in Version 3.88. I had to go to version 3.87 so that the duration in the AnimationFrames is not ignored.

@zekeatchan
Copy link
Collaborator

Hi @sylvainpolletvillard. Thanks for submitting this issue. We have fixed this and pushed it to the master branch. It will be part of the next release. Do test it out and let us know if you encounter any issues.

@sylvainpolletvillard
Copy link
Contributor Author

I confirm this commit fixes the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants