Entity::getRotation: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
Line 34: Line 34:
}}
}}
==See also==
==See also==
{{Entity_function_c}}
{{Entity_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 18:03, 1 May 2024

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