getElementComponentRotation
Client
Returns the rotation of a vehicle's or object's component, in degrees.
float, float, float|false getElementComponentRotation(vehicle|object element, string component [, string base = "parent"])
Parameters
| Name | Type | Description |
|---|---|---|
| element | vehicle|object | The vehicle or object. |
| component | string | The component's name, as getElementComponents lists it. |
| base | string | Relative to what: "world", "root" (the element itself) or "parent" (the component's parent frame). Case does not matter.default "parent" |
Returns
Three numbers rx, ry, rz in degrees, or false if the component does not exist.
Example
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
local rx, ry, rz = getElementComponentRotation(vehicle, "door_lf_dummy")
outputDebugString(("Left door: %.1f, %.1f, %.1f"):format(rx, ry, rz))
endComing from MTAThe same as MTA's
getVehicleComponentRotation, but it also works on objects.