Skip to content

A3D_GetPosition

imshooter edited this page Oct 17, 2026 · 1 revision

The position of a physics object.

native bool:A3D_GetPosition(Physic:physicid, &Float:x, &Float:y, &Float:z);

Parameters

Parameter Description
Physic:physicid Physics object to read.
&Float:x Position on the X axis.
&Float:y Position on the Y axis.
&Float:z Position on the Z axis.

Returns

  • true when the position was written.
  • false when physicid is not a physics object.

Remarks

The position of a sphere or a box is its centre. The position of an object shaped like a model is the origin of the model, the same place an object of that model would be created at.

Example

stock Float:GetObjectDistance(playerid, Physic:physicid) {
    new
        Float:x,
        Float:y,
        Float:z
    ;

    if (!A3D_GetPosition(physicid, x, y, z)) {
        return -1.0;
    }

    return GetPlayerDistanceFromPoint(playerid, x, y, z);
}

Related

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally