Move up against gravity

Hi, I need object which moves against gravity upwards.
For example one objects moves up (weight -1) and if another with weight 1 fall on it they will stay at one place in the air.

How can I do this?

I tried this for object which should move up:

timer.performWithDelay(1,function() object1:setLinearVelocity( 0, -3 ); object1.rotation=0; end,0)

But its not good it ignoring physics so much…

Is there any easiest/better way how to do this?

Thanks. [import]uid: 59968 topic_id: 18597 reply_id: 318597[/import]

Assuming both objects must be physics objects…

Apply a positive impulse to your object that is moving against gravity to send it up, and the physics engine will slow the acceleration until it stops and then starts to fall back down.

There is not enough information here to fully understand the behavior you are trying to achieve.

-David
[import]uid: 96411 topic_id: 18597 reply_id: 71418[/import]

I’ve never liked using impulse much. I never would get the control or results I was looking for. If impulse doesn’t work the way you would like I would suggest try using force.

http://developer.anscamobile.com/reference/index/bodyapplyforce [import]uid: 38820 topic_id: 18597 reply_id: 71420[/import]

Well, you can image it like this…

I have set normal gravity and all object falling down… But now I need another objects which will be move up against gravity (anti-gravity object…)
Is there any easy way how to do this?

Thanks. [import]uid: 59968 topic_id: 18597 reply_id: 71913[/import]

So do you need 1 of the objects to have different gravity than the others? The object moving up, does it need to act like it has gravity i.e. speeds up the further it goes?

If not, you can just move the object by changing its Y coordinate. For example keep subtracting 1 from the Y coordinate and it will move upwards. Otherwise it’s not clear what you need. [import]uid: 31262 topic_id: 18597 reply_id: 71948[/import]

Yes, I need different gravity for 1 object (or groups of objects)…

They dont have to accelerate when moving up, but for example:

Object which moving up has weight 1
Falling object has weight 1

When they collide they will stay “in the air”.

Hope you can understand what I mean :wink:
[import]uid: 59968 topic_id: 18597 reply_id: 71952[/import]

likewise, i have flying objects that fall with normal gravity, ex rocks, bombs, then i have some helium balloons that need to be anti-gravity and move upward. how would i achieve this? i would like to avoid transitions, preferably i would like to use physics objects. any help would be appreciated

thanks in advance

niko [import]uid: 34595 topic_id: 18597 reply_id: 106835[/import]