Hi guys,
i updated Cocos lib to 3.4 from 3.3, and i have problem…
I am creating sprite, setting physics body to it, and adding sprite to parent node. Then i am moving the parent node (change pos to -X) and the physics body (child and also child sprite itself) stays fixed on the screen as it would be not related to sprite, or to anything!
In 3.3, if i moved the parent node, its child Sprite moved, and Sprite’s physics body too…
What’s wrong? How should i manage it?
Here is sample code:
auto spriteTmx = Sprite::create(); // or can be Node::create() spriteTmx->setPhysicsBody(body); targetNode->addChild(spriteTmx, 1);
Then i am changing the pos of targetNode, and the physics bodies (child sprite) is fixed on the screen, while its parent is moving.
Looks like some bug of Parent-child positioning in 3.4, otherwise don’t know what to do if this is not bug but intention.
PS: if i add sprite to parent node without physics body, it works as expected. Child sprite is moved with parent.
Thx