Wednesday, February 26, 2025
spot_img

I’m having issues utilizing parallel 1 node and node element Opacity – Cocos Creator


tween(nodeV)
.sequence(
tween().parallel(tween().to(0.5, { scale: new Vec3(2, 2, 2) }, { easing: ‘sineOut’ }), tween().to(0.5, { opacity: 0 })),
tween().name(() => {
nodeV.energetic = false;
}),
tween().name(() => {
this.node.energetic = true;
}),
)
.begin();

What’s the model of Cocos?

Please strive the code under:

    tween(this.nodeV)
    .sequence(
    tween().parallel(tween().to(0.5, { scale: new Vec3(2, 2, 2) }, { easing: 'sineOut' }), tween(this.nodeV.getComponent(UIOpacity) as UIOpacity).to(0.5, { opacity: 0 })),
    tween().name(() => {this.nodeV.energetic = false;}),
    tween().name(() => {this.node.energetic = true;}),
    )
    .begin();

Right here is the hyperlink to your reference. Tween Instance | Cocos Creator



1 Like

You may want to make sure that the opacity change applies to the right element, like nodeV.getComponent(UIOpacity).opacity = 0. Have you ever tried that?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles