GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS
Returns the world position of an offset relative to the entity.
Useful to spawn things in front of or behind an entity.
Signature
Vector3 GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(Entity entity, float offsetX, float offsetY, float offsetZ); // 0x1899F328B0E12848 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | entity | Entity |
| 2 | offsetX | float |
| 3 | offsetY | float |
| 4 | offsetZ | float |
Facts
| Name | GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS |
|---|---|
| Hash | 0x1899F328B0E12848 |
| Namespace | |
| Returns | Vector3 |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local coords = Citizen.InvokeNative(0x1899F328B0E12848, -- GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS
PlayerPedId(), -- Entity entity
0.0, -- float offsetX
0.0, -- float offsetY
0.0, -- float offsetZ
Citizen.ResultAsVector()
)
print(coords.x, coords.y, coords.z)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const coords = Citizen.invokeNative("0x1899F328B0E12848", // GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS
PlayerPedId(), // Entity entity
0.0, // float offsetX
0.0, // float offsetY
0.0, // float offsetZ
Citizen.resultAsVector()
);
const [x, y, z] = coordsVector3 coords = Function.Call<Vector3>((Hash)0x1899F328B0E12848, // GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS
API.PlayerPedId(), // Entity entity
0.0f, // float offsetX
0.0f, // float offsetY
0.0f // float offsetZ
);Related ENTITY natives
- GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS
- GET_OBJECT_INDEX_FROM_ENTITY_INDEX
- GET_ENTITY_COORDS
- GET_PED_INDEX_FROM_ENTITY_INDEX
- GET_VEHICLE_INDEX_FROM_ENTITY_INDEX
- GET_WORLD_POSITION_OF_ENTITY_BONE
- _GET_CARRIABLE_FROM_ENTITY
- _GET_ENTITY_WORLD_POSITION_OF_DIMENSIONS
- _GET_LAST_ENTITY_TO_DAMAGE_ENTITY
- _SET_ENTITY_COORDS_AND_HEADING_NO_OFFSET
- HAS_ENTITY_CLEAR_LOS_TO_ENTITY_IN_FRONT
- SET_ENTITY_COORDS_NO_OFFSET
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.