Objects falling to slow..?

Ok so my objects are falling to slow… here is littlery the onl code i have in the file(Not including the composer setup)

local \_W = display.contentWidth local \_H = display.contentHeight local physics = require("physics" ) physics.setScale( 60 ) physics.start( ) local Circle = {} local spawnCircles = function () local FallDown = math.random(display.contentWidth \* 0.2, display.contentWidth \* 0.8 ) circle = display.newImageRect("circle.png", 31, 31 ) circle.x = FallDown circle.y = -100 physics.addBody( circle, "dynamic", {density = .01, friction = 0.5, bounce = 0.1 }) circle.gravityScale = 0.1 end myTimer = timer.performWithDelay( 100, spawnCircles, -100)

I tried lowering and uping the physics scale… i tried uping gravity  and ive tried desity … nothing seems to work… help? thanks

Solved! i added physics.setGravity( 0, 0 ) and it worked :slight_smile:

Wait, how did setting the gravity to 0 worked for you?

Default physics value is 0,9.8 … lowering that number should actually make it to fall slower, since you are decreasing the ammount of gravity that pushes the object to -Y

I’m replying to you on my phone but lete try to explain this…

So right before I started physics I add the code physics.setGravity(0,0)

And then on the object that’s falling I added(in that function) I added physics physics.setGravity(0,10) and that made it fall faster… Did I make that under stand able? I could send some code in a couple hours …

physics.setGravity( x, y ) sets the world gravity.  Typically x will be 0 since in the real world gravity only works up and down.  The default is  0, 9.8.    Setting it to 0, 10 only slightly increases gravity.  You shouldn’t need to set it to 0, 0 first.  You can control gravity on individual objects by setting it’s gravity scale.  See:  https://docs.coronalabs.com/api/type/Body/gravityScale.html

Rob

Ok, so in simple terms I set the worlds gravity to (0) and I set my objects gravity to (0,10) because I needed it to go slightly faster no insanely fast…if that doesn’t explain it idk what will lol

When you say:  physics.setGravity(0, 10) you are changing the world gravity, not your single object’s gravity.   The only way to change an individual object’s gravity is to use .gravityScale… 

Rob

Solved! i added physics.setGravity( 0, 0 ) and it worked :slight_smile:

Wait, how did setting the gravity to 0 worked for you?

Default physics value is 0,9.8 … lowering that number should actually make it to fall slower, since you are decreasing the ammount of gravity that pushes the object to -Y

I’m replying to you on my phone but lete try to explain this…

So right before I started physics I add the code physics.setGravity(0,0)

And then on the object that’s falling I added(in that function) I added physics physics.setGravity(0,10) and that made it fall faster… Did I make that under stand able? I could send some code in a couple hours …

physics.setGravity( x, y ) sets the world gravity.  Typically x will be 0 since in the real world gravity only works up and down.  The default is  0, 9.8.    Setting it to 0, 10 only slightly increases gravity.  You shouldn’t need to set it to 0, 0 first.  You can control gravity on individual objects by setting it’s gravity scale.  See:  https://docs.coronalabs.com/api/type/Body/gravityScale.html

Rob

Ok, so in simple terms I set the worlds gravity to (0) and I set my objects gravity to (0,10) because I needed it to go slightly faster no insanely fast…if that doesn’t explain it idk what will lol

When you say:  physics.setGravity(0, 10) you are changing the world gravity, not your single object’s gravity.   The only way to change an individual object’s gravity is to use .gravityScale… 

Rob