Skip to content

A3D_CreateStaticObject

imshooter edited this page Oct 18, 2026 · 2 revisions

Create a physics object that never moves, shaped like the collision of a model.

Nothing is shown. Use it under an object created by the script.

native Physic:A3D_CreateStaticObject(
    modelid,
    Float:x,
    Float:y,
    Float:z,
    Float:rx = 0.0,
    Float:ry = 0.0,
    Float:rz = 0.0,
    worldid = -1
);

Parameters

Parameter Description Default
modelid Model whose collision gives the shape.
Float:x Position on the X axis.
Float:y Position on the Y axis.
Float:z Position on the Z axis.
Float:rx Rotation on the X axis. 0.0
Float:ry Rotation on the Y axis. 0.0
Float:rz Rotation on the Z axis. 0.0
worldid Virtual world it collides in, or -1 for every world. -1

Returns

  • The physics object.
  • INVALID_PHYSIC_ID when the model has no collision, or the world is full.

Remarks

A static object keeps the exact collision of the model: its spheres, its boxes and its faces, each with its own surface. Physics objects bounce off it and the queries find it as A3D_HIT_STATIC, with the id of the static object.

Nothing is shown. Create the object players see yourself, at the same position and rotation, with CreateObject or CreateDynamicObject. The game knows nothing of the static object either, so players and vehicles do not collide with it unless the object they see has a collision of its own.

Use it for every object a script maps that physics objects or queries must meet, such as ramps, tables, walls and furniture. The map of the game is already in the component and needs nothing.

Example

Maps a stunt ramp that balls roll up.

public OnGameModeInit() {
    CreateObject(1634, 1700.0, -2470.0, 13.85, 0.0, 0.0, 0.0);
    A3D_CreateStaticObject(1634, 1700.0, -2470.0, 13.85, 0.0, 0.0, 0.0);

    return 1;
}

Related

  • A3D_CreateObject: Create a moving physics object shaped like the collision of a model, or as models.json describes the model.
  • A3D_CreateStaticBox: Create an invisible box that never moves, such as a wall or a floor.
  • A3D_RemoveBuilding: Remove the map objects of a model around a point, as RemoveBuildingForPlayer does for what players see.
  • A3D_DestroyObject: Destroy a physics object, a static object or a zone, and the global object that shows it.

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