how to turn an object into sensor upon contact.

i tried to do it in the contact listener:

"PreSolve": does not seem to effect the body at all

"BeginBontact": The object bounces off sometimes.
some times it pass through but with reduced velocity.

anybody know what i am missing here? 🙁

thanx.
Sensor should only take effect going forward. If you disable the current contact as well (there's some method on b2Contact for this), it should work.

Original thread: https://box2d.org/forum/viewtopic.php?t=4653