SetElementAngularVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Requirements)
(Remove obsolete Requirements section)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setElementAngularVelocity ( element theElement, float rx, float ry, float rz )          
bool setElementAngularVelocity ( element theElement, float rx, float ry, float rz )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[element]]:setAngularVelocity|angularVelocity|getElementAngularVelocity}}
{{OOP||[[element]]:setAngularVelocity|angularVelocity|getElementAngularVelocity}}
Line 25: Line 25:
addEventHandler ( "onColShapeHit", root, onColShapeHit )
addEventHandler ( "onColShapeHit", root, onColShapeHit )
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|1.5.5-9.14060|1.5.5-9.14060|}}


==See Also==
==See Also==
{{Element functions}}
{{Element functions}}

Latest revision as of 17:14, 7 November 2024

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

Syntax

bool setElementAngularVelocity ( element theElement, float rx, float ry, float rz )

OOP Syntax Help! I don't understand this!

Method: element:setAngularVelocity(...)
Variable: .angularVelocity
Counterpart: getElementAngularVelocity


Required Arguments

Returns

Returns true if it was succesful, false otherwise.

Example

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