PhysicsApplyDamping

From Multi Theft Auto: Wiki
Revision as of 15:11, 14 February 2020 by CrosRoad95 (talk | contribs) (Created page with "__NOTOC__ {{Client function}} Slows down rigid body ==Syntax== <syntaxhighlight lang="lua"> bool physicsApplyDamping( physics-rigid-body theRigidBody, float dumping)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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