PhysicsApplyAngularVelocity

From Multi Theft Auto: Wiki
Revision as of 15:00, 14 February 2020 by CrosRoad95 (talk | contribs) (Created page with "__NOTOC__ {{Client function}} Applies angular velocity to rigid body ==Syntax== <syntaxhighlight lang="lua"> bool physicsApplyVelocity( physics-rigid-body theRigidBody, flo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Applies angular velocity to rigid body

Syntax

bool physicsApplyVelocity( physics-rigid-body theRigidBody, float velocityX, float velocityY, float velocityZ)             

Required Arguments

  • theRigidBody: rigid body you want to apply velocity
  • velocityXYZ: angular velocity you wants to apply

Returns

True if angular velocity got applied, false otherwise.

Example

Spawn box and apply horizontal angular velocity.

local box = physicsCreateShape(physics, "box", 1)
local boxrb = physicsCreateRigidBody(box)
physicsSetProperties(boxrb, "position", 0,0,5)
physicsApplyAngularVelocity(boxrb, 0,0,10)

See Also