I have a CCLayer.
I create a CCNode* from another function, return it and add it to the CCLayer.
When I ret to remove it bu tag however I am told it doesn’t exist
cocos2d::CCNode* Class::function() {
cocos2d::CCNode* n = cocos2d::CCNode::create()
… I add stuff to it….
node~~>setTag;
return node;
}
Then elsewhere I do:
mynode = Class::function;
addChild;
and when ready to move:
removeChildByTag;
I am told that the child doesn’t exist
I even tried
mynode = Class::function;
mynode~~>setTag(9);
addChild(mynode, 3);
and when ready to move:
removeChildByTag(9);
I am told that the child doesn’t exist