Skip to content

A3D_SetPlanar

imshooter edited this page Oct 17, 2026 · 1 revision

Keep a moving physics object at its height, so it only moves along the ground.

native bool:A3D_SetPlanar(Physic:physicid, bool:planar = true);

Parameters

Parameter Description Default
Physic:physicid Physics object to change.
bool:planar true to keep its height, false to let it move freely again. true

Returns

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

Remarks

A planar object never moves up or down. Gravity and every push along the Z axis are ignored while it is planar, so it slides and rolls on the plane where it was. It still turns freely.

It keeps balls on a table that must never jump, or objects of a game played on a flat floor.

Example

A block for a table game that slides on ice.

stock Physic:CreateSlidingBlock(modelid, Float:x, Float:y, Float:z) {
    new Physic:block = A3D_CreateBox(modelid, 0.1, 0.1, 0.04, x, y, z, 0.0, 0.0, 0.0, 0.2);

    A3D_SetPlanar(block);
    A3D_SetFriction(block, 0.05);

    return block;
}

Related

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