# ENTITY::_SET_ENTITY_ROTATION_PARALLEL_TO_LINE

- **Hash:** `0xD45BB89B53FC0CFD`
- **Namespace:** ENTITY
- **Runtime name (Lua/JS):** `SetEntityRotationParallelToLine`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/ENTITY/_SET_ENTITY_ROTATION_PARALLEL_TO_LINE

## Signature

```c
void _SET_ENTITY_ROTATION_PARALLEL_TO_LINE(Entity entity, float x1, float y1, float z1, float x2, float y2, float z2, int p7);
```

## Parameters

- `entity` (`Entity`)
- `x1` (`float`)
- `y1` (`float`)
- `z1` (`float`)
- `x2` (`float`)
- `y2` (`float`)
- `z2` (`float`)
- `p7` (`int`)

## Returns

`void`

## Description

*Source: alloc8or RDR3 NativeDB*

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.

*Source: VORPCORE RDR3natives*

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

### Lua

```lua
SetEntityRotationParallelToLine(entity, x1, y1, z1, x2, y2, z2, p7)

-- always available, by hash
Citizen.InvokeNative(0xD45BB89B53FC0CFD, entity, x1, y1, z1, x2, y2, z2, p7)
```

### JavaScript

```js
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);
```

### C#

```csharp
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. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to 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 `InvokeNative` with the hash — it always works.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
