发现个ccc3.0 tween 的bug bug bug 人工置顶~

let a=tween().by(1,{position:new Vec3(0,this.startOffset,0)},{easing:“quintOut”});
let b=tween().by(1, { position: new Vec3(0, -this.speed, 0) }).repeatForever();
this.tweener = tween(this.content);
this.tweener.then(a).then(b).start();

如上代码无法运行(unknown id),把repeatForever 换成repeat可以正常运行… 求官方解决~~

@引擎组

1赞

tween(this.node)
.by(1, {position: new Vec3(-1, 0, 0)})
.by(1, {position: new Vec3(0, 1, 0)})
.repeatForever()
.start();

与楼上同样的错误,再麻烦了,感谢

image
可参考这两种。

谢谢回覆
但我的需求是先做完一段tween后,再接着repeat某个动作
您的第一个例子,如果repeatForever前先做一个tween,也会出错

注:我上面的写法在2.4.3是可以动作的

let a = {a: 10};
let action = cc.tween(a)
    .to(0.4, {a: 100})
    .repeatForever(
        cc.tween()
            .to(0.5, {a: 10})
            .to(0.5, {a: 100})
    )
    .start();

我也碰到相同的问题了,你试试上面这段代码,控制台会打印unknown id。
通过断点发现是因为Action的update方法被执行了,而Action的update里只有一个打印1007错误的代码。

然后我去看源码,发现RepeatForever类没有实现update,我以为是这个原因,然后去翻2.4.5的源码发现他的RepeatForever也没有实现update,说明不是这个原因。

至此,我没找到具体的原因

2.x我这样写是没有问题的,意思是这算2.x的bug?

而且那还是2016年的时候,应该是2.x的时候,可能都没有tween

    tween(this.node)
    .by(1, { position: new Vec3(-1, 0, 0) })
    .call(()=>{
        tween(this.node)
        .by(1, { position: new Vec3(0, 1, 0) })
        .repeatForever()
        .start();
    })
    .start()

这么写就没问题了,不过这是通过两个不同tween来实现的,算是取巧的方式了,临时规避下问题,还是真香的

谢谢回覆 :slight_smile:
我们后来也都改成这样实现了