CCCallFunc question

CCCallFunc question
0.0 0


Hey guys.

I’m trying to set up so set up a CSequence of actions to run on a sprite in one of my character classes.
The sequence is basically:- (Animation, CCCallFunc, Animation)

I’m getting errors and crashes when I include the CCCallFunc in the sequence.

To be clear on the structure of my code. I have a character class that contains its sprite (not derived) and a method it needs to call after the first animation has played and before the second animation starts.

BreathedIn = CCCallFunc::create((CCObject*)this, callfunc_selector(CCharacter::OnFinishBreathIn));

adding this to the sequence causes a crash.

Can anyone help with this?


Could you provide more informations? A demo based on HelloCpp is better. Thanks.


my guess is you might have forgotten to add a NULL in the sequence…

CCSequence::create(action1, action2, action3, NULL);

Try to debug and see if the control actually reaches onFinishBreathIn function.