PhysicsApplyAngularVelocity

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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