I have an issue can someone please help me solve it? I have made a level which has some scroll features with work by moving the layer, but when I have added physicsBody to my sprites which are in my layer the scroll feature doesn’t work at them. they stay wat the same position. But I want to make them move along with the layer.
I am using Cocos2d-x 3.0 RC0
This is a sample of what I mean.
To create a sprite
Sprite* testBuildS = Sprite::create(“Test.png”);
testBuildS->setTag(1);
testBuildS->setPosition(50,300);
testBuildS->setPhysicsBody(PhysicsBody::createBox(testBuildS->getContentSize()));
this->addChild(testBuildS, 4);
And i move my layer just with
this->setPosition(myPos);
@jmedeiros
Yes I did I even tried to move the layer in this sample i found on wiki “https://github.com/Yangtb/newPhysics” but the problem still exists the layer is moving but items with physics body stay on the same place.
Thanks for your answer.
But is there actually a way to use box2d without using inbuilt cocos2d-x physics system? Beacuse I couldn’t find ENABLE_BOX2D_INTEGRATION anywhere. I have seen some classes check for it but I haven’t found a class which defines it.