attachCamToEntity
ATTACH_CAM_TO_ENTITY0xFEDB7D269E8C60E3The GTA V native ATTACH_CAM_TO_ENTITY of the CAM namespace, as LS:MP client scripts call it: the global function attachCamToEntity, in JavaScript and in Lua.
attachCamToEntity(
cam: Cam,
entity: Entity,
xOffset: number,
yOffset: number,
zOffset: number,
isRelative: boolean
): voidattachCamToEntity(
cam: Cam,
entity: Entity,
xOffset: number,
yOffset: number,
zOffset: number,
isRelative: boolean
)Usage
JavaScript
attachCamToEntity(cam, entity, xOffset, yOffset, zOffset, isRelative);Lua
attachCamToEntity(cam, entity, xOffset, yOffset, zOffset, isRelative)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
attachCamToEntity(cam, entity, offset, isRelative);Lua · with vectors
attachCamToEntity(cam, entity, offset, isRelative)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
cam | Cam | number | integer |
entity | Entity | number | integer |
xOffset | float | number | number |
yOffset | float | number | number |
zOffset | float | number | number |
isRelative | BOOL | boolean | boolean |
Returns
Nothing. In JavaScript the call evaluates to undefined.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Last param determines if its relative to the Entity
Reference
- Namespace
- Camera CAM
- In the game
void ATTACH_CAM_TO_ENTITY(Cam cam, Entity entity, float xOffset, float yOffset, float zOffset, BOOL isRelative)- Hash
0xFEDB7D269E8C60E3