I want to change the loop of a tween dynamically, while the tween is playing
I tried using function for the loop with no success
this.loops = 2
this.tween = this.scene.tweens.add({
targets: this,
duration: 1500,
loop: () => {
return this.loops
},
onLoop: () => {
if (this.loops < 10) {
this.loops++
}
},
})
also, I tried using updateTo
this.tween.updateTo('loop', this.loops, false)
any help?
Thanks