Entity::setRotation: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
Line 38: Line 38:


==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:05, 1 May 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


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


Syntax

entity.setRotation(pitch, roll, yaw, rotationOrder, p5);

Required Arguments

  • pitch: float
  • roll: float
  • yaw: float
  • rotationOrder: int
  • deadCheck: Boolean

Return value

  • void

Example

const vehicle = mp.vehicles.at(0);
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
vehicle.setRotation(0.0, 0.0, -157.0, 2, true);



See also