object.isFixedRotation

Type Boolean
Object Body
Library physics.*
Revision 2017.3060
Keywords body, isFixedRotation

Overview

A boolean for whether the rotation of the body should be locked, even if the body is under load or subjected to off-center forces. The default is false.

Example

-- Create a rectangle
local myRect = display.newRect( 0, 0, 20, 100 )

-- Add a body to the rectangle
physics.addBody( myRect, "dynamic" )

myRect.isFixedRotation = true