B2.Body:setGravityScale: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 5: Line 5:


=== Description ===
=== Description ===
Sets the gravity scale of the body.
Strengthens or weakens the effect of the world gravity on a body.
<source lang="lua">
<source lang="lua">
b2.Body:setGravityScale(scale)
b2.Body:setGravityScale(scale)
</source>
</source>
'''Note''': increased gravity can decrease stability
Setting the gravity scale to 0 will make your body float. You can set a negative number, for example -1 will inverse gravity.


=== Parameters ===
=== Parameters ===

Revision as of 03:08, 28 November 2021