cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

[3.7.2]"Tween" does not work properly in some cases

Open mambo723 opened this issue 1 year ago • 2 comments

Cocos Creator version

3.7.2

System information

Windows10 Chrome

Issue description

"Tween" does not work properly in some cases.

Relevant error log output

[Action update]. override me

Steps to reproduce

import { _decorator, Component, tween, log } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Test')
export class Test extends Component {
    start() {
        tween(this)
            .call(() => { log('********** 0') })
            .repeatForever(
                tween(this)
                    .delay(1)
                    .call(() => { log('********** 1') })
            )
            .start();
    }
}

Using Tween like this in any component will appear.

If remove the ".call(() => { log('********** 0') })" line of code, it will work normally.

import { _decorator, Component, tween, log } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Test')
export class Test extends Component {
    start() {
        tween(this)
            .repeatForever(
                tween(this)
                    .delay(1)
                    .call(() => { log('********** 1') })
            )
            .start();
    }
}

Minimal reproduction project

No response

mambo723 avatar Apr 06 '23 03:04 mambo723

tween(this)
    .delay(1)
    .call(() => { log('********** 1') })
    .repeatForever()
    .start();

tween(this)
    .repeatForever(
        tween()
            .delay(1)
            .call(() => { log('********** 1') })
    )
    .start();

Doesn't work even when used like this.

mambo723 avatar Apr 06 '23 03:04 mambo723

tween(this)
    .delay(1)
    .call(() => { log('********** 1') })
    .union()
    .repeatForever()
    .start();

Using like this works as expected.

Are those usages wrong? But I don't see anything special about "repeatForever" in the docs.

mambo723 avatar Apr 06 '23 03:04 mambo723

It was fixed at https://github.com/cocos/cocos-engine/pull/17088

dumganhar avatar Jun 15 '24 12:06 dumganhar