Stop gravity?

I need to have physics added to an objcet so that I can use setLinearVelocity but I need to stop the objects gravity so it doesn’t fall to the bottom of the screen. Currently all my physics calls is:

physics.addBody(fly) fly:setLinearVelocity(100,120)

Can I stop it falling to the bottom?

Hey,

You can just set gravityScale for your object to zero. That should do the trick :slight_smile:

[lua]
fly.gravityScale = 0
[/lua]

Rich

Perfect, was unaware of gravityScale. Thanks Rich!

Hey,

You can just set gravityScale for your object to zero. That should do the trick :slight_smile:

[lua]
fly.gravityScale = 0
[/lua]

Rich

Perfect, was unaware of gravityScale. Thanks Rich!