Difference between revisions of "B2.Body:setGravityScale"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
 
(2 intermediate revisions by 2 users not shown)
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">
+
<syntaxhighlight lang="lua">
 
b2.Body:setGravityScale(scale)
 
b2.Body:setGravityScale(scale)
</source>
+
</syntaxhighlight>
 +
 
 +
'''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 ===

Latest revision as of 16:59, 12 July 2023