Type Function Object Body Library physics.* Return value none Revision Release 2024.3703 Keywords body, applyTorque See also object:applyAngularImpulse() object:applyForce() object:applyLinearImpulse()
A function that accepts a numerical value for applied rotational force. The body will rotate about its center of mass.
object:applyTorque( appliedForce )
Number. Amount of force to be applied.
-- Create a rectangle local myRect = display.newRect( 0, 0, 100, 100 ) -- Add a body to the rectangle physics.addBody( myRect, "dynamic" ) myRect:applyTorque( 100 )