Hi all, I am trying to tween colour alpha property, but getting this result?
Why it changes a lot of colours if I just use black colour to tween? Thanks.
Since you are using the to property in the tween, the meaning of ‘to’ from the above code is to change the color to (0, 0,0, 150) in 3.15 seconds, then the color will move closer and closer to the target value from the initial value in 3.15 seconds, reaching the target value in 3.15 seconds. Therefore, there will be a situation like the video, where the color keeps changing and finally becomes black.
If you want the picture to become what you want in a flash, you can set it like this.
this.spr.color = new Color(0,0,0,150);
But my initial color is 0, 0, 0, 0 (black and full alpha)
so it should just change alpha property? I mean when I tween position Vector (0, 0, 0) to Vector (150, 0, 0) it will tween just x position… so/
I need smooth animation. I remember Cocos recommends to change Color property instead of add UIOpacity component and tween opacity property of it.