_SET_ENTITY_ROTATION_PARALLEL_TO_LINE
Sets the entity rotation so it is parallel to the direction defined by two world coordinates, without moving the entity.
0xD45BB89B53FC0CFDSetEntityRotationParallelToLineSignature
void _SET_ENTITY_ROTATION_PARALLEL_TO_LINE(Entity entity, float x1, float y1, float z1, float x2, float y2, float z2, int p7);Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | — |
x1 | float | — |
y1 | float | — |
z1 | float | — |
x2 | float | — |
y2 | float | — |
z2 | float | — |
p7 | int | — |
Returns void
Description
Sets the entity rotation so it is parallel to the direction defined by two world coordinates, without moving the entity.
This does not make the entity face either coordinate directly; it aligns the entity with the line direction between the two points. Observed usage passes p7 = 1.
Sets the entity's rotation so that it becomes parallel to the direction defined by the line between coords1 and coords2, without moving the entity from its current position.
This native does NOT make the entity face coords1 or coords2. Instead, it keeps the entity at its current world position and adjusts its orientation so that it is aligned parallel to the direction derived from the two coordinates
Usage
SetEntityRotationParallelToLine(entity, x1, y1, z1, x2, y2, z2, p7)
-- always works, by hash
Citizen.InvokeNative(0xD45BB89B53FC0CFD, entity, x1, y1, z1, x2, y2, z2, p7)JavaScript and C#
SetEntityRotationParallelToLine(entity, x1, y1, z1, x2, y2, z2, p7);
// by hash
Citizen.invokeNative('0xD45BB89B53FC0CFD', entity, x1 + 0.0000001, y1 + 0.0000001, z1 + 0.0000001, x2 + 0.0000001, y2 + 0.0000001, z2 + 0.0000001, p7);Function.Call((Hash)0xD45BB89B53FC0CFD, entity, x1, y1, z1, x2, y2, z2, p7);- 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. - The name is a community guess and may change. If the named call is missing in your client build, use
InvokeNativewith the hash — it always works.
Sources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.