Anybody knows how to make objects attract to each other?
attract bodies
General DiscussionYou can use b2World::Query to detect which shapes are close together. Then you can apply equal and opposite forces to drive the associated bodies together. In the future you should use the sensor feature when it becomes available. This should be available by 2.1.0.
Original thread: https://box2d.org/forum/viewtopic.php?t=198