Skip to content

A3D_IsValidObject

imshooter edited this page Oct 17, 2026 · 1 revision

Whether a physics object, a static object or a zone exists.

native bool:A3D_IsValidObject(Physic:physicid);

Parameters

Parameter Description
Physic:physicid Physics object to check.

Returns

  • true when it exists.
  • false when it does not.

Remarks

Ids are reused, so a valid id may belong to a newer object than the one a script kept long ago. Keep ids in variables that are reset on destroy, or mark objects with A3D_SetExtra.

Example

stock bool:IsBallInPlay(Physic:ball) {
    if (!A3D_IsValidObject(ball)) {
        return false;
    }

    return A3D_IsMoving(ball);
}

Related

  • A3D_DestroyObject: Destroy a physics object, a static object or a zone, and the global object that shows it.
  • A3D_SetExtra: Keep a number on a physics object, such as the item it stands for.

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