Physics removeBody

Hi,

Currently the only way to modify the physics on an object after the object’s scale is changed is by deleting the object and recreating it. This is not very efficient (we need to redefine every thing again for the object like events etc…), can’t we have a physics.removeBody()?

Please consider making such a function it will really help many of us

Regards
Elvan [import]uid: 12167 topic_id: 8575 reply_id: 308575[/import]

+1, or a replaceBody.

i have actually requested that physics and body become separate. it makes it *slightly* more difficult to code, but not really. in flash Box2D you set the [lua].userData[/lua] property to a sprite and then update the position/rotation of the sprite in your enterFrame, based on the physics body position/rotation.

It would be good to have the choice of both methods really.

maybe [lua]physics.addBody(image,…)[/lua] for the normal way and [lua]myBody = physics.addBody(nil, …)
physics.addImage(myImage, myBody)[/lua]

for a new method… or something like that. [import]uid: 6645 topic_id: 8575 reply_id: 30803[/import]