Hey
i have strange behavior when using CCMoveTo to move Sprite A to position of Sprite B
Sprite A and B are children of Sprite C which is child of Sprite D
all anchorpoint’s are (0,0)
what i have in code :
D->addChild(C,1);
C->addChild(A,1);
C->addChild(A,1);
CCPoint BOriginalPos = B->getPosition(); //this is the sprite where i want to move sprite A to , which is : x160.000000 ,y:81.000000
CCMoveTo* AMoveToB = CCMoveTo::create(0.3f,BOriginalPos );
CCSequence* AMovesToBSequence = CCSequence::create(AMoveToB , NULL);
A->runAction(AMovesToBSequence);
but when i log print the A position im getting x187.925095 ,y:81.000000
and i expect it to be x160.000000 ,y:81.000000 as B
its looks like the animation action moves A in the world space X and Y and not to the Node space that is the position that is relative to to Sprite C
but how can i fix this ?
what am i doing wrong here ?