I can't get this to work and it is driving me insane. I simply want to play my animation when it is called. I am using Spritebuilder
and Cocos2d
. I have a CCNode
that I am importing into the scene using
#import "heroCharacter.h"
//Reference
CCNode *_heroContainer;
//Then
CCNode *hero = [CCBReader loadAsScene:@"heros/panda"];
[_heroContainer addChild:hero z:1 name:@"level1"];
That CCNode
contains various timeline animations.
I am trying to call the animation using :
CCBAnimationManager* animationManager = _heroContainer.userObject;
NSLog(@"AM: %@", animationManager);
[animationManager runAnimationsForSequenceNamed:@"ouch"];
AM
returns a Null value. How would I correctly reference this?
I presume it is because I am importing it and it is losing its connection but not sure how to do it correctly.