how to make the applied forces on an object zero, so that the only force on the object is gravity

Hi all,

I have an object that has external forces being applied to it (ie a bouncing ball hitting it) on collision I just want the object to have only gravity affecting it... how do I go about doing this? I tried applying forces but it just doesn't work

thanks

i think if you post your code, it will be easier to help you

So you want an object to be affected by gravity but not by other physics object? If that is the case you might want to try using collision filters or seperating the physics objects in to display groups. Check out the collision detection docs for more details.
http://developer.anscamobile.com/content/game-edition-collision-detection

I am assuming you still want it to have collisions with other objects. In that case calebr2048's solution won't work

I suggest you to test one of following two approaches.

1) Make the body static and move it downwards using transitions.

2) Keep body dynamic, and attach "pre-collision" listener to the body. In this listener, make the body static for very short interval of time (say 50ms) when the collision happens. I hv a doubt this won't be smooth though.

I cheated and increased the density of the object to a high value... so that any other forces don't really affect it... so it just falls straight down.... not sure if this is the most elegant solution but it works :)

just a thought... I know I can get the force that was applied on collision... is it possible to set the force to zero on collision so that all that is applied to the object is gravity?

views:1623 update:2011/9/28 21:38:26
corona forums © 2003-2011