Gravity
by Andre Mercier · in Torque 2D Beginner · 09/11/2013 (1:53 pm) · 2 replies
Hello, me and my friend need help on how to used gravity for PlayerObjects. Thanks.
About the author
#2
09/11/2013 (11:49 pm)
Moreover, you can set how scene gravity affects your objects using:%obj.GravityScale = 1; // or %obj.setGravityScale(1); // if you want your object to stop being affected by gravity %obj.GravityScale = 0;When you set the gravity scale of an object its gravity equals scale*scene gravity.
Associate Mike Lilligreen
Retired T2Der
When you set the gravity you set it through the x/y axis. Each axis is specified in metres/sec therefore setting -9.8m/s (Y Axis) gives an approximate earth gravity. Gravity affects all "dynamic" bodies in the world.