How to run several cocos builder animations in a sequence

274 views Asked by At

I have multiple animations that created using cocosbuilder. They are in different time lines. I can run animation by using,

  [animationManager runAnimationsForSequenceNamed:@"Walking"];

How can i run second animation after first one ended. Is there a way to run multiple animations in asequence.

1

There are 1 answers

0
Nico On

It should be concerned to "CocosBuilder + CCBReader", however, if you are using 2.1 version you can change the "sequenceCompleted" method of CCBAnimationManager to the following:

- (void) sequenceCompleted
{
    NSString *completedSequenceName = [runningSequence.name copy];
    int nextSeqId = runningSequence.chainedSequenceId;
    runningSequence = NULL;

    if (nextSeqId != -1)
    {
        [self runAnimationsForSequenceId:nextSeqId tweenDuration:0];
    }

    [delegate completedAnimationSequenceNamed:completedSequenceName];
    [completedSequenceName release];
}

Use this code it could help you.

This link seems useful for you.

https://github.com/cocos2d/CocosBuilder/issues/121