isSensor = false?

is there a way to toggle the state of the isSensor property for a physics body?

this seems like good logic for one sided platforming but i couldn’t find a way to turn it off when called from a collision event. i have a workaround in place but it’s not optimal.

does anyone know if this is possible? if not, then please consider this a feature request. [import]uid: 9389 topic_id: 3664 reply_id: 303664[/import]

anyone? [import]uid: 9389 topic_id: 3664 reply_id: 11281[/import]

I have the same problems. What is your workaround to get one-sided platforms to work? [import]uid: 10284 topic_id: 3664 reply_id: 13631[/import]

Sorry for the confusion around one-sided platforms. The documentation needs to be improved for this.

Fwiw, another developer posted their approach to this in an earlier thread:

http://developer.anscamobile.com/forum/2010/08/29/help-one-sided-platforms#comment-5461

Tim [import]uid: 8196 topic_id: 3664 reply_id: 13672[/import]

Coincidentally, I ended up doing basically what was suggested in the thread above.

My thoughts were, it would have been much easier if you could simply toggle the sensor property ON/OFF. Whether that’s feasible or not, I don’t know but the logic is nice & easy. [import]uid: 9389 topic_id: 3664 reply_id: 13680[/import]

i have added a feature request
http://developer.anscamobile.com/forum/2010/12/10/override-contact-precollision-box2d-contactsetenabledfalse

seemingly in box2d there is an option to set the contact to false (ie override it from actually happening in the presolve)
[as3]contact.setEnabled(false)[/as3]
[import]uid: 6645 topic_id: 3664 reply_id: 13688[/import]

It seems like a good idea to me to do it that way.

It’s just one opinion but I thought there was way too much messing around to do something that was essentially pretty basic. Especially considering that sensor objects were already made available, why not also allow the same sensor object to mutate into an active physics body simply by toggling the state to TRUE or FALSE.

Just my 2cents. [import]uid: 9389 topic_id: 3664 reply_id: 13692[/import]

yes turning isSensor off would also be a good solution and probably preferable. but since box2d has the other capability i’m hoping that’ll be easy to include too
[import]uid: 6645 topic_id: 3664 reply_id: 13702[/import]