I want to use box2D to create a movement system for an RTS game. How can I make bodies block the movement of other bodies while preventing these bodies from pushing each other?

  • \$\begingroup\$ Have you tried increasing friction and/or changing the mass of the bodies you don't want to be "pushed"? \$\endgroup\$ – Eran Boudjnah Dec 28 '13 at 20:18

It sounds like you want standard collision detection, but a custom collision response. Sensors (Fixtures subsection 6.3) provide that functionality.

  1. Disable the default collision (use static bodies, filtering, etc.)
  2. Attach a sensor and implement a custom collision response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.