Entity::getRotation

From RAGE Multiplayer Wiki
Revision as of 18:03, 1 May 2024 by Shr0x (talk | contribs) (→‎See also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax


enum eRotationOrder { // Rotation Orders
    XYZ = 0,
    XZY,
    YXZ,
    YZX,
    ZXY,
    ZYX,
    MAX,
}


Syntax

entity.getRotation(rotationOrder);

Required Arguments

  • rotationOrder: Int (specifies which axis rotates before the other axis in a certain order)

Return value

  • Vector3

Example

const vehicle = mp.vehicles.at(0);
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
const rotation = vehicle.getRotation(2);
mp.console.logInfo(`Vehicle Rotation: ${JSON.stringify(rotation)}`, false, false);


See also