Skip to content

A3D_DestroyObject

imshooter edited this page Oct 18, 2026 · 2 revisions

Destroy a physics object, a static object or a zone, and the global object that shows it.

native bool:A3D_DestroyObject(Physic:physicid);

Parameters

Parameter Description
Physic:physicid Physics object to destroy.

Returns

  • true when it was destroyed.
  • false when physicid is not a physics object.

Remarks

The global object the component created is destroyed with the body. A streamer object given with A3D_AttachDynamicObject is not, since the script owns it.

Ids are reused. After an object is destroyed, the next one created may get the same id, so set the variables that kept it to INVALID_PHYSIC_ID. Destroying INVALID_PHYSIC_ID does nothing.

Every object a script created is destroyed when the script unloads. It is safe to destroy an object inside its own callbacks.

Example

Destroys every thrown object once it comes to rest.

public A3D_OnStopped(Physic:physicid, Float:x, Float:y, Float:z) {
    A3D_DestroyObject(physicid);

    return 1;
}

Related

  • A3D_IsValidObject: Whether a physics object, a static object or a zone exists.
  • A3D_CreateObject: Create a moving physics object shaped like the collision of a model, or as models.json describes the model.
  • A3D_OnStopped: A moving physics object came to rest, or fell below 3dandreas.floor and was stopped there.

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