Type Function Object Body Library physics.* Return value none Revision Current Public Release (2013.2076) Keywords Body, applyForce Sample code /CoronaSDK/SampleCode/Physics/ See also Body:applyAngularImpulse() Body:applyLinearImpulse() Body:applyTorque()
A function that accepts x,y components of a linear force, applied at a given point with x,y world coordinates. If the target point is the body's center of mass, it will tend to push the body in a straight line; if the target is offset from the body's center of mass, the body will spin about its center of mass.
For symmetrical objects, the center of mass and the center of the object will have the same position: (object.x, object.y). Also note that the amount of force may need to be fairly high to move heavy objects.
Body:applyForce( xForce, yForce, bodyX, bodyY )
myBody:applyForce( 500, 2000, myBody.x, myBody.y )