Skip to main content

Coordinates

Everything in Los Santos exists at a point defined by three numbers: X, Y, and Z. Whether you want to place an NPC on a sidewalk, detect when a player enters an alley, or position a mission marker, you need to understand how the game's coordinate system is laid out.

The three world axes

GTA V uses a right-handed Cartesian coordinate system measured in metric units (meters):

  • X axis (East / West): Positive values move East toward the Tataviam Mountains; negative values move West toward Pacific Bluffs.
  • Y axis (North / South): Positive values move North toward Mount Chiliad and Paleto Bay; negative values move South toward Los Santos International Airport.
  • Z axis (Altitude): Positive values rise into the sky; 0 is roughly sea level; negative values descend into the ocean depths or underground metro tunnels.
North (+Y)
|
|
West (-X) --------+-------- East (+X)
|
|
South (-Y)

Up (+Z) / Down (-Z)

The world origin: (0, 0, 0)

The origin point (0, 0, 0) is not at the center of the city. It sits offshore, southwest of Los Santos at sea level. Legion Square, the traditional center of downtown, is roughly at (190f, -850f, 30f). Mount Chiliad's summit is at (501f, 5604f, 797f).

Reading a position in C#

You read an entity's coordinates through its Position property, which returns a GTA.Math.Vector3:

using GTA;
using GTA.Math;

Ped player = Game.Player.Character;
if (player != null && player.Exists())
{
Vector3 currentPosition = player.Position;
float x = currentPosition.X;
float y = currentPosition.Y;
float z = currentPosition.Z;

GTA.UI.Screen.ShowSubtitle($"Pos: X={x:F1}, Y={y:F1}, Z={z:F1}", 1000);
}

The ground trap: finding proper footing

If you pick coordinates from a map or guess an altitude, placing an entity directly at that Z coordinate will often spawn it floating in mid-air or stuck inside the asphalt.

To ensure an entity lands cleanly on the actual collision mesh of the ground, use World.GetGroundHeight:

Vector3 desiredSpot = new Vector3(200f, -800f, 50f);
float groundZ = World.GetGroundHeight(desiredSpot);
Vector3 safeSpot = new Vector3(desiredSpot.X, desiredSpot.Y, groundZ);

Next, we look at vectors: manipulating directions, forward offsets, and distances.