PhysicsApplyDamping

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

Slows down rigid body

Syntax

bool physicsApplyDamping( physics-rigid-body theRigidBody, float dumping)             

Required Arguments

  • theRigidBody: rigid body you want to apply velocity
  • dumping: how much rigid body must slow down, if negative value, effect will inverted, make it speed up

Returns

True if angular velocity got applied, false otherwise.

Example

After threee seconds make box rapidly slow down falling

local box = physicsCreateShape(physics, "box", 1)
local boxrb = physicsCreateRigidBody(box)
physicsSetProperties(boxrb, "position", 0,0,100)

setTimer(function()
  physicsApplyDamping(boxrb, 10000)
end,3000,1)

See Also