Tween Node Opacity

Obviously I’m new to Cocos Creator, but I’m enjoying it very much.

I’m attempting to tween the opacity of a node in and out by a duration. Are you able to tween the opacity? Every time I try any tween example I can find it goes into an error.

this.tween = cc.tween(this.node)
             .to(1, {opacity:65})
             .start();

I know that will just go from opacity value of 255 to 65, but I can’t get this simple tween to work at all. It complains about not being able to clone the target.

Should I use an action, animation, or some other way?

Thanks

1 Like

I ended up just adjusting opacity manually, but it would be great to know how to get a tween or action to handle it.

i haven’t used cocos creator but i think there should be cc.FadeTo action that you can use on node.runAction

1 Like

Thank you! I see it in my VS Code autocomplete. I will try it out today.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.