gradually increasing gravity.

How can I gradually increase gravity? I know I can do it for a certain object like this 

object.gravityScale = object.gravityScale +1 

How does one add gravity to all of gravity though?

I am spawning images every 200 mili seconds so this is why I need to set it to all of gravity.

Hi Max,

Just use a combination of “.getGravity()” and “.setGravity()”. On whatever increment, get the current gravity values, add whatever amount to the Y value, then assign (update) that value using .setGravity().

http://docs.coronalabs.com/daily/api/library/physics/getGravity.html

http://docs.coronalabs.com/daily/api/library/physics/setGravity.html

Brent

Thanks I didn’t think of that

code below for anyone else

local gxa,gya=physics.getGravity() physics.setGravity(0,gya+0.1) 

Hi Max,

Just use a combination of “.getGravity()” and “.setGravity()”. On whatever increment, get the current gravity values, add whatever amount to the Y value, then assign (update) that value using .setGravity().

http://docs.coronalabs.com/daily/api/library/physics/getGravity.html

http://docs.coronalabs.com/daily/api/library/physics/setGravity.html

Brent

Thanks I didn’t think of that

code below for anyone else

local gxa,gya=physics.getGravity() physics.setGravity(0,gya+0.1)