isBodyActive=false versus removeBody

Is the concept behind isBodyActive that you can use it to temporarily turn off physics for an object, rather than having to totally doing a removeBody and then addBody again?

Yes. isBodyActive is a property of Box2D which disabled processing of a body within the 2D environment. removeBody is a function of Corona which removes a body from the Box2D environment.

removeBody was not originally in Corona, for around two years, if I remember correctly. isBodyActive has always been there.

Yes. isBodyActive is a property of Box2D which disabled processing of a body within the 2D environment. removeBody is a function of Corona which removes a body from the Box2D environment.

removeBody was not originally in Corona, for around two years, if I remember correctly. isBodyActive has always been there.

is there any way to make a collision event detectable only once? I have a sensor that loads a movie upon collision with a falling dic. on occasion, if the disc bounces twice, it loads the movie in twice, creating havoc. I tried playing with the isBodyActive and removeBody to nullify the disc so it couldn’t bounce twice, but of course they won’t work while collision is being detected. I tried changing the friction and bounce properties of the sensor to begin with, but the ball bounces anyway since it has bounce built into it necessary for other parts of its trip towards the sensors.

any ideas would be greatly appreciated… thanks!

http://www.coronalabs.com/blog/2012/11/27/introducing-physics-event-contact/

thanks, horacebury!!! perfection!

is there any way to make a collision event detectable only once? I have a sensor that loads a movie upon collision with a falling dic. on occasion, if the disc bounces twice, it loads the movie in twice, creating havoc. I tried playing with the isBodyActive and removeBody to nullify the disc so it couldn’t bounce twice, but of course they won’t work while collision is being detected. I tried changing the friction and bounce properties of the sensor to begin with, but the ball bounces anyway since it has bounce built into it necessary for other parts of its trip towards the sensors.

any ideas would be greatly appreciated… thanks!

http://www.coronalabs.com/blog/2012/11/27/introducing-physics-event-contact/

thanks, horacebury!!! perfection!