getElementBoneQuaternion | Multi Theft Auto: Wiki Skip to content

getElementBoneQuaternion

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


This function retrieves how a particular bone rotates in relation to the element.

The use of quaternions are more effective and do not generate issues like gimbal lock that might arise with Euler angles, so they are a preferable choice for rotation.

Syntax

getElementBoneQuaternion ( )

Code Examples

client

This example retrieves the rotation of the player's head in quaternion.The retrieved values ​​can be used for calculations.

local playerBone = 1
local playerBoneX, playerBoneY, playerBoneZ, playerBoneW
addEventHandler("onClientResourceStart", resourceRoot,
function()
playerBoneX, playerBoneY, playerBoneZ, playerBoneW = getElementBoneQuaternion(localPlayer, playerBone)
end
)

See Also

Element Functions