This project has moved and is read-only. For the latest updates, please go here.

Stop bodies from pushing each other?

Sep 17, 2012 at 9:18 PM

I'd like to stop bodies from pushing each other away and act like a wall to other bodies.

I've done this before using a box2d port for as3, where i could simply set the bodytype of contactB to kinematic presolve and dynamic again postsolve, but this seems to completely crash the world here. 

Sep 19, 2012 at 2:41 AM

use collisiongroups and/or collisioncategories on the bodies/fixtures

Sep 19, 2012 at 1:38 PM

how would that help me? i want them to collide, but not being able to push each other away

Sep 19, 2012 at 9:47 PM
Edited Sep 19, 2012 at 10:33 PM

You can try this: make a ghost body that follows the dynamic body (static or kinematic). In begincontact enable the collision only when necessary for the main and the ghost according to your logic.

You can also manipulate the collision results inside the callbacks by applying opposite impulse to the wall body but that's more low-level.