1

I know I can make b2Body sensor by setting special flag in b2BodyDef. But what I need is to temporally turn body into sensor, and then turn it back to not-sensor again. So I need a switch that will let another bodies to go through this body.

Thank you!

Dennis Krut
  • 423
  • 1
  • 6
  • 11
  • 1
    if you want just to allow bodies pass - then change b2Filter iVar of b2Fixture. You can read more in the box2d manual – Andrew Feb 17 '12 at 08:54
  • I agree with Andrew, I think the best way is to alter the filtering using maskBits, and category bits, or you can dynamically destroy the existing fixture and then create a temporary fixture that is set to be a filter. – tams Feb 19 '12 at 20:47

1 Answers1

0

You can just set its position to somewhere where is really far away from you and set it back later.

Ringo_D
  • 342
  • 1
  • 2
  • 12