Stop Collision Temporarily

How do I stop an object from engaging in collisions temporarily while still being affected by the other forces of physics?

The only thing I was able to think of to resolve this was to add a collision filter, but it seems like you can only do that when the “body” is first created and then it can’t be changed.

Thanks for any help! [import]uid: 36054 topic_id: 8050 reply_id: 308050[/import]

It seems like turning isSensor true/false while physics is running does actually work, so I guess this is resolved now :stuck_out_tongue: [import]uid: 36054 topic_id: 8050 reply_id: 28663[/import]

I think you mean “how do you stop a body from colliding with other objects?” because a sensor object will still fire collision events - that’s it’s job - but will not actually bounce off anything else.

If you want the body to collide with other objects - like, site on a platform - but not fire the collision listener function, simply remove the listener by calling:

[lua]myBody:removeEventListener( “collision”, myBody )[/lua] [import]uid: 8271 topic_id: 8050 reply_id: 28747[/import]