setElementAngularVelocity | Multi Theft Auto: Wiki Skip to content

setElementAngularVelocity

Client-side
Server-side
Shared

Pair: getElementAngularVelocity

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Sets the angular velocity of a specified, supported element (Applies a spin to it).

OOP Syntax Help! I don't understand this!

  • Method:element:setAngularVelocity(...)
  • Variable: .angularVelocity

Syntax

bool setElementAngularVelocity ( element theElement, float rx, float ry, float rz )
Required Arguments
  • theElement: The element to apply the spin to. Can be either a player , ped , object , vehicle or a custom weapon .
  • rx: velocity around the X axis
  • ry: velocity around the Y axis
  • rz: velocity around the Z axis

Returns

  • bool: value

Returns true if it was succesful, false otherwise.

Code Examples

shared
function onColShapeHit ( thePlayer, matchingDimension )
-- When a player hits the collision shape, give him a spin
setElementAngularVelocity ( thePlayer, 0, 0, 20 )
end
addEventHandler ( "onColShapeHit", root, onColShapeHit )

See Also

Element Functions