Tween event "repeat"?

I was looking tween docs and it seems that there is no event to trigger when we have repeat, so it triggers on every repeat?

example:

this.tween = this.Icon.tween(this.Icon.getLocalScale())
            .to(new pc.Vec3(factor, factor, factor), duration, pc.ExponentialIn)
            .yoyo(true)
            .repeat(repeat)
            .on('complete', function () {

            });
        // .on('repeat', function () {
        //     this.app.fire('gc:drop');
        // }).bind(this);

Hi @mirkoni,

Yes there is no event triggered on repeat, that’s not a supported event. And correct I think complete will fire on each and every repeat cycle, most likely that’s expected?

You can study the source code of the tween library here: https://github.com/playcanvas/playcanvas-tween/blob/main/tween.js#L281

1 Like

loop is fired on each repeat cycle except for the last one: https://github.com/playcanvas/playcanvas-tween#loop