Change variable value on tween stagger?

Hi, I’m currently using the tween stagger function like this:

        const coinTweenDur = 220;
        let Ci = 0;
        this.tweens.add({
            targets: coins,
            angle: 360,
            x: Ci * 96,
            duration: coinTweenDur,
            delay: mainGame.tweens.stagger(coinTweenDur)
        })

I have an array called Coins, which contains some images of coins that are initially put outside of the screen, and I want to put them on their position with a tween, this position being 0x96, 1x96, 2x96, etc.
The thing is that I want to change the Ci variable every time the animation ends, but I haven’t found a way to do this.

this.tweens.add({
  x: mainGame.tweens.stagger(96),
  /* … */
});

Like that?

1 Like

Yes! this works just as I need :smiley: