Call a specific function after sequence ends?

My version: cocos2d-x-3.8.1

Hi, I have a Sprite and a bunch of actions (a Sequence). I’m using runAction method to run this sequence on my sprite. Everything well, but I want to call a function at the end of the sequence. I don’t want to pass any parameters to it. I just want to call a simple function without parameter.

I heard CC_CALLBACK_0 and other 1,2,3 variants of this thing. But I don’t know how to use that.

Thanks in advance for any help. :information_source: :heartpulse: :copyright: :radio_button: :copyright: :o: :heavy_dollar_sign: :two: D

http://cocos2d-x.org/programmersguide/4/index.html#sequences-and-how-to-run-them

The number at the end of CC_CALLBACK_ is simply just the number of parameters you are passing to the callback.

you can also add this action at the end of your sequence -

auto finalCB = CallFunc::create( [] () {
// call your function here
});

this will do your work. :smile: