Skip to content

A3D_GetVelocity

imshooter edited this page Oct 17, 2026 · 1 revision

The velocity of a moving physics object.

native bool:A3D_GetVelocity(Physic:physicid, &Float:vx, &Float:vy, &Float:vz);

Parameters

Parameter Description
Physic:physicid Physics object to read.
&Float:vx Velocity on the X axis, in metres per second.
&Float:vy Velocity on the Y axis, in metres per second.
&Float:vz Velocity on the Z axis, in metres per second.

Returns

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

Remarks

The velocity is that of the centre of mass. An object at rest gives zeros.

Example

stock bool:IsFalling(Physic:physicid) {
    new
        Float:vx,
        Float:vy,
        Float:vz
    ;

    if (!A3D_GetVelocity(physicid, vx, vy, vz)) {
        return false;
    }

    return vz < -1.0;
}

Related

  • A3D_SetVelocity: Set the velocity of a moving physics object and wake it up.
  • A3D_GetSpeed: The speed of a moving physics object.
  • A3D_GetMoveAngle: The direction a moving physics object travels on the ground, as a facing angle.

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
Callbacks

Clone this wiki locally