How to remove sprite after sequence of animation?

for example:

auto star = Sprite::create("star.png");
this->addChild(star);
auto action = MoveTo::create(0.5, Point(x, y));
auto action2 = RotateBy::create(4, 720);
auto sequence = Sequence::create(action, action2, NULL);
star->runAction(sequence);

how to remove after finished?

1 Like

auto sequence = Sequence::create(action, action2, RemoveSelf::Create() , NULL);

5 Likes

There is an action RemoveSelf that you can add to the end that will do that.

2 Likes