| Property | Value |
|---|---|
| Native Name | GET_ENTITY_COORDS |
| Hash | 0x3FEF770D40960D5A |
| Return Type | Vector3 |
| API Set | client |
| Parameters | entity (Entity), alive (BOOL) |
Description: Gets the current coordinates (world position) for a specified entity.
Parameters
entity(Entity) — The entity to get the coordinates from.alive(BOOL) — Unused by the game, potentially used by debug builds of GTA in order to assert whether or not an entity was alive.
Examples
local playerCoords = GetEntityCoords(PlayerPedId())
print(playerCoords) -- vector3(...)
const [playerX, playerY, playerZ] = GetEntityCoords(PlayerPedId(), false);
console.log(`${playerX}, ${playerY}, ${playerZ}`);
using static CitizenFX.Core.Native.API;
// ...
Vector3 playerCoords = GetEntityCoords(PlayerPedId(), false);
// or the preferred use of C# wrapper
Vector3 playerCoords = Game.PlayerPed.Position;
Debug.WriteLine($"{playerCoords}");