Animation onStart callback not working - Bug?

Hello,

I’m trying to play a sound at the start of a animation like this:

 this.anims.create({
       key: "linkSprakle",
       duration: this.gameSpeed,
       frames: this.anims.generateFrameNames("links", {
         prefix: "link",
         suffix: ".png",
         start: 1,
         end: 15,
       }),
       onStart: () => {
         this.sound.play("link_formed_sfx");
       },
     });

But that is not working, also the same onStart callback implementation in the example, https://phaser.io/examples/v3/view/animation/on-start-callback, is not working either, it only works in Phaser v3.3 and lower.

Any ideas on how to play a sound at the start of animation?

Thanks

https://photonstorm.github.io/phaser3-docs/Phaser.Animations.Events.html

Hi,

this.on('animationstart', () => console.log('ANIM START'))

I need it for a specific animation only.

@samme how do I implement the animation start example in your link?

Look at the SPRITE_ANIMATION_ events.