Tween parallel not working as expected

Looking at the examples provided for tween (Cocos creator 3.8):

let tweenDuration: number = 1.0;
let t1 = tween(this.node)
    .to(tweenDuration, { position: new Vec3(0, 10, 0) })

let t2 = tween(this.node)
    .to(tweenDuration, { position: new Vec3(0, -10, 0) })

tween(this.node).parallel(t1, t2).start(); // Convert t1 and t2 to parallel tweens and add the current tween

What should I expect from this piece of code?
I tried running it, but only the t2 applies. Well I suspected that it could not because both tweens want to manipulate position and tested a parallel tween like this:

let t1 = tween(this.node)
.by(3, {position:new Vec3(1000, 0, 0)})
  
let t2 = tween(this.node)
.by(3, {position:new Vec3(0, 1000, 0)})

let t3 = tween(this.node)
.by(3, {rotation:new Quat(0, 0, 1, 0)})

// tween(this.node).parallel(t1, t2).start()
tween(this.node).parallel(t1, t3).start()

Now this one executes in parallel.

The question is: Is that example really not supposed to be logical? Is it a bug? or what?

I have also seen situations that I set a tween on position in start function and manipulated position in update function manually. But it did not work as expected.

1 Like