I have an Egg (dynamic circle body) and some moving Walls (static body, but move horizontally by changing x property by my Corona program, not by Box2D force).
When the Egg lands on the Wall, and the wall moves, the egg still stands at a position, so after the wall moved off, the egg falls.
I need the egg to “stick” to the wall (that is, when the wall move left 20 pixel, the egg also move left the same amount). Is it possible with Box2D body parameters?
First, you should not move box2d bodies setting their position/rotation. Because you are not providing the body’s velocity in this case collision with this body can not be simulated properly. Static bodies even does not have the ability to have velocity. If you want to move the body i think the best way is to use kinematic bodies or b2LineJoint. To make the egg stick you can use b2ContactListener class to handle collision of the egg with the platform. When the collision is handled – create b2WeldJoint.