Hi everyone, I’ve been playing with the new integrated physics implementation in the 3.0 beta 2 release, and can’t see a way to get the PhysicsWorld to move and scale with a layer (so that I can achieve camera panning effects). I create the scene and child layer in the same way as shown in the documentation:
auto scene = Scene::createWithPhysics(); scene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL); auto layer = HelloWorld::create(); layer->setPhyWorld(scene->getPhysicsWorld());
Adding sprites and setting their body with sprite->setPhysicsBody works as expected, but as soon as I start to move the layer for camera panning etc, the shapes and bodies move out of sync with the sprite. I assume this is because the PhysicsWorld is bound to the parent scene, and not the child layer. Does anyone know how to bind the PhysicsWorld to the child layer, so that it moves and scales with it?