Anyway to change how fast a physics object falls?

For example, I have a brick and a cloud. When the screen is flipped I want the brick to fall quickly and the cloud to fall more leisurely. I have tried adjusting the density and frictions but to no effect. Is there any way to change the fall rates of two different objects?
Thanks! [import]uid: 9660 topic_id: 9479 reply_id: 309479[/import]

Hi,

You are forgetting basic principle demonstrated by Galileo on leaning tower of pisa.

Regardless of Mass (and so density) of the object, the gravitational acceleration on all bodies is same.

So, you won’t get any difference in their fall speeds unless, the lighter body has some upward force on them.

To achieve what you want, apply some force on cloud in opposite direction of gravity.

using below function you will get gravity vector. Use it in each frame to find out where is gravity vector pointing and apply opposite force slightly smaller in magnitude on cloud.

gx, gy = physics.getGravity()
Following is untested example code.

[lua]-- assuming your cloud object is already defined.

local function gameLoop(event)
local gx , gy
gx, gy = physics.getGravity()

cloud:applyForce(gx*0.7, gy*0.7, cloud.x, cloud.y)

end

Runtime:addEventListener(“enterFrame”,gameLoop)[/lua]

[import]uid: 48521 topic_id: 9479 reply_id: 34736[/import]

Sorry, but it can be done simly by setting the property linearDamping:

http://developer.anscamobile.com/reference/index/bodylineardamping [import]uid: 8271 topic_id: 9479 reply_id: 34737[/import]

duh… or you could do what Horacebury said. :slight_smile: [import]uid: 48521 topic_id: 9479 reply_id: 34789[/import]