Entity::getRotation
JavaScript
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);