PhysicsApplyAngularVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} Applies angular velocity to rigid body ==Syntax== <syntaxhighlight lang="lua"> bool physicsApplyVelocity( physics-rigid-body theRigidBody, flo...")
 
(No difference)

Latest revision as of 15:00, 14 February 2020

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