How to change default gravity ?

Just wondering if there is a way to change the gravity. I have this object:
physics.addBody( rowonecrate1, { density=3.0, friction=0.5, bounce=0.3 } ) I want to slow this object down. I also have other objects on screen. Just wondering If I can manually manipulate the gravity of each object or not as well. [import]uid: 6134 topic_id: 27607 reply_id: 327607[/import]

Gravity is world based. You can set the gravity for the whole world, but not for an individual body. Believe me we want this feature!
[import]uid: 19626 topic_id: 27607 reply_id: 112111[/import]

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

And no, you can’t set individual gravities. The way around this is to code your own physics like what I do. s=ut+0.5at^2 finally came in useful. [import]uid: 108204 topic_id: 27607 reply_id: 112116[/import]

@Romeo -

rowonecrate1.linearDamping = 1

Try that. Increase to slow it down further. Not what you requested RE gravity but a possible workaround depending on what you are going for.

Peach :slight_smile: [import]uid: 52491 topic_id: 27607 reply_id: 112152[/import]

stipid question if I put this in my code ( physics.setGravity( gx, gy ) ) what is the default values. [import]uid: 6134 topic_id: 27607 reply_id: 112159[/import]

If you don’t specify physics.setGravity() then it’s 9.8 meters per second per second I think.

If you do a physics.setGravity(gx,gy) then your gravity will be set to whatever values the variable gx and gy hold.

[import]uid: 19626 topic_id: 27607 reply_id: 112179[/import]

@Rob - you were correct RE 9.8.

http://developer.anscamobile.com/reference/index/physicssetgravity

Peach :slight_smile: [import]uid: 52491 topic_id: 27607 reply_id: 112258[/import]