0
\$\begingroup\$

Consider the following code...

cocos2d::Node* parent = cocos2d::Node::create();
cocos2d::Node* child = cocos2d::Node::create();
parent->addChild(child);
parent->rotate(-90.0f); // But its not affecting the child position

When I am rotating the parent node by an angle, It's not affecting the child node position. How can I get it right? Please help. Thanks.

\$\endgroup\$
-1
\$\begingroup\$

Use setRotation() method instead of rotate()

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.