Set collision filter after body is added

How do you set the collision filter of an object after it has been created? I’ve tried body.filter, body.collisionFilter, but neither work. Is it even possible? [import]uid: 8782 topic_id: 6105 reply_id: 306105[/import]

Update: tried setting body.maskBits and body.categoryBits, but didn’t work either. There’s got to be some workaround (removing body and creating new?) Having to change the collision filter is going to be a big part of my game. [import]uid: 8782 topic_id: 6105 reply_id: 20897[/import]

You’ve got to destroy the body and create a new one. I’m pretty sure you can’t change a physics body. Flag the body for deletion, then in an enterFrame check if a new body is needed. If it is create new with the desired collision filter [import]uid: 30185 topic_id: 6105 reply_id: 20926[/import]

How do you flag the body for destrucion and destroy just the physics object? I can only remove the display object AND the physics object. Any way to remove just the physics? Thanks [import]uid: 8782 topic_id: 6105 reply_id: 21244[/import]

Sorry, got no clue. But why not delete both and recreate them? The user wont notice the change if it’s in an enterframe [import]uid: 30185 topic_id: 6105 reply_id: 21258[/import]

Hmm, that could be kind of tricky, though. You’d have to store width/height (since that can change in my game), linear velocity, angular velocity, etc., and restore them all. But I might have to do that. Thanks for the help. [import]uid: 8782 topic_id: 6105 reply_id: 21265[/import]

I’d really like it if there was a way to change the collision filter of a physics body during game play. I think this would open a lot of possibilities for app and game development.
Please help ansca people. [import]uid: 11712 topic_id: 6105 reply_id: 28077[/import]

You should participate in a contest for among the best blogs on the web. I’ll advocate this site!
Blue klonopin lubricious Ambien sale Clench Viagra flomax snatch [import]uid: 136554 topic_id: 6105 reply_id: 95973[/import]