Make 2 objects fall at different speeds (physics/gravity)

I’m using physics and gravity to make objects fall in my game, how can I alter the speed at which objects fall?

The objects are falling down in a straight line from a point at the top of the screen. [import]uid: 36590 topic_id: 18571 reply_id: 318571[/import]

Hey there,

obj.linearDamping could be what you want - try this plug and play code. (You may want to play with it a bit, it’s very rough.)

[lua]require ( “physics” )
physics.start()
physics.setGravity( 0, 5 )
physics.setDrawMode ( “hybrid” )

local shape1 = display.newCircle( 80, 80, 30 )
physics.addBody(shape1, “dynamic”, {density = 1.0, friction = 0.3, bounce = 0.2, radius = 30})

local shape2 = display.newCircle( 280, 80, 30 )
physics.addBody(shape2, “dynamic”, {density = 0.1, friction = 0.3, bounce = 0.2, radius = 30})

shape2.linearDamping = 1

local ground = display.newRect( 0, 470, 320, 10 )
physics.addBody(ground, “static”)[/lua]

Hope this helps!

Peach :slight_smile: [import]uid: 52491 topic_id: 18571 reply_id: 71350[/import]