SET_ENTITY_ROTATION
Sets the rotation of a specified entity in the game world.
Signature
void SET_ENTITY_ROTATION(Entity entity, float pitch, float roll, float yaw, int rotationOrder, BOOL bDeadCheck);Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The entity to rotate. |
pitch | float | The pitch (X-axis) rotation in degrees. |
roll | float | The roll (Y-axis) rotation in degrees. |
yaw | float | The yaw (Z-axis) rotation in degrees. |
rotationOrder | int | Specifies the order in which yaw, pitch, and roll are applied, see |
bDeadCheck | BOOL | Usually set to |
Returns void
Description
Sets the rotation of a specified entity in the game world.
NativeDB Introduced: v323This is the server-side RPC native equivalent of the client native SET_ENTITY_ROTATION.
Usage
SetEntityRotation(entity, pitch, roll, yaw, rotationOrder, bDeadCheck)
-- always works, by hash
Citizen.InvokeNative(0xa345efe, entity, pitch, roll, yaw, rotationOrder, bDeadCheck)JavaScript and C#
SetEntityRotation(entity, pitch, roll, yaw, rotationOrder, bDeadCheck);
// by hash
Citizen.invokeNative('0xa345efe', entity, pitch + 0.0000001, roll + 0.0000001, yaw + 0.0000001, rotationOrder, bDeadCheck);Function.Call((Hash)0xa345efe, entity, pitch, roll, yaw, rotationOrder, bDeadCheck);- Float parameters: Lua integers (
10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason.
See also
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.