Hi Everyone,
I’m trying to create a looping animation with a random repeatDelay
. This code should work but for some reason the new random value for repeatDelay
isn’t being applied to the currentAnim
:
const blinkAnimation = this.anims.create({
key: "blink",
frames: blinkFrames,
frameRate: 10,
repeat: -1,
repeatDelay: 1000,
});
blinkAnimation.on("repeat", currentAnim => {
currentAnim.repeatDelay = Phaser.Math.RND.integerInRange(2000, 6000);
});
When I log the value of currentAnim.repeatDelay
I can see the new random number is being applied, but the actual animation still just repeats based on the original value.
Any ideas what I might be doing wrong?
Thanks!!