Skip to content

A3D_IsMoving

imshooter edited this page Oct 17, 2026 · 1 revision

Whether a moving physics object is awake.

native bool:A3D_IsMoving(Physic:physicid);

Parameters

Parameter Description
Physic:physicid Physics object to check.

Returns

  • true when it moves.
  • false when it rests, or physicid is not a moving physics object.

Remarks

An object falls asleep when it has moved less than about three centimetres a second for half a second. A sleeping object costs nothing to simulate and sends nothing to players. A3D_OnStopped is called when it falls asleep.

A push, a new velocity, a hit by something awake or the removal of what it rests on wakes it again.

Example

Waits for every ball of a table to stop before the next shot.

static Physic:gBalls[16];

stock bool:AreBallsResting() {
    for (new i; i != sizeof (gBalls); ++i) {
        if (A3D_IsMoving(gBalls[i])) {
            return false;
        }
    }

    return true;
}

Related

  • A3D_OnStopped: A moving physics object came to rest, or fell below 3dandreas.floor and was stopped there.
  • A3D_GetSpeed: The speed of a moving physics object.

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