How to run action FadeIn, FadeOut, FadeTo for a Node

I have a node, it contain some sprites. I want to create action fade in, out for this node but when i create action for it, I don’t see anything happen.

FadeIn* fadeIn = FadeIn::create(1.0f);
node->runAction(fadeIn);

Someone can tell me why, and How to creat this action for a node?

Try casting the node to a sprite.

Try node->setCascadeOpacityEnabled(true);

1 Like

Have you set visibility to true? FadeIn just set opacity through period of time. Trynode->runAction(Sequence::create(Show::create(), FadeIn::create(1.0), NULL));

2 Likes

Thank you for support.