object.linearDamping

Type Number
Object Body
Library physics.*
Revision Release 2024.3703
Keywords body, linearDamping
See also object:setLinearVelocity()
object:applyLinearImpulse()
object:applyForce()

Overview

The numerical value for how much the body's linear motion is damped. The default is zero (0).

Example

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

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

-- Set the rectangle's linear damping
myRect.linearDamping = 5