# CAMERA::ATTACH_CAM_TO_ENTITY

- **Hash:** `0xFDC0DF7F6FB0A592`
- **Namespace:** CAMERA
- **Runtime name (Lua/JS):** `AttachCamToEntity`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/CAMERA/ATTACH_CAM_TO_ENTITY

## Signature

```c
void ATTACH_CAM_TO_ENTITY(Cam cam, Entity entity, float xOffset, float yOffset, float zOffset, BOOL isRelative);
```

## Parameters

- `cam` (`Cam`)
- `entity` (`Entity`)
- `xOffset` (`float`)
- `yOffset` (`float`)
- `zOffset` (`float`)
- `isRelative` (`BOOL`)

## Returns

`void`

## Description

Last param determines if its relative to the Entity

## Usage

### Lua

```lua
AttachCamToEntity(cam, entity, xOffset, yOffset, zOffset, isRelative)

-- always available, by hash
Citizen.InvokeNative(0xFDC0DF7F6FB0A592, cam, entity, xOffset, yOffset, zOffset, isRelative)
```

### JavaScript

```js
AttachCamToEntity(cam, entity, xOffset, yOffset, zOffset, isRelative);

// by hash
Citizen.invokeNative('0xFDC0DF7F6FB0A592', cam, entity, xOffset + 0.0000001, yOffset + 0.0000001, zOffset + 0.0000001, isRelative);
```

### C#

```csharp
Function.Call((Hash)0xFDC0DF7F6FB0A592, cam, entity, xOffset, yOffset, zOffset, isRelative);
```

- 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.

*Sources: alloc8or RDR3 NativeDB.*
