Skip to content

A3D_SetFriction

imshooter edited this page Oct 17, 2026 · 1 revision

Set how much a physics object grips what it touches.

native bool:A3D_SetFriction(Physic:physicid, Float:friction);

Parameters

Parameter Description
Physic:physicid Physics object to change.
Float:friction Friction, 0.0 for ice and about 1.0 for rubber. Starts at 0.5.

Returns

  • true when the friction was set.
  • false when physicid is not a physics object.

Remarks

The friction of a contact is the square root of the product of the frictions of both bodies. The map, players, vehicles and actors have 0.2, so an object of 0.5 slides on the map with about 0.32. An object of 0.0 slides on everything as on ice.

It works on every physics object, static ones included, which makes slippery floors and ramps.

Example

An icy ramp that crates slide down.

public OnGameModeInit() {
    new Physic:ramp = A3D_CreateStaticBox(4.0, 10.0, 0.3, 1700.0, -2470.0, 14.5, 20.0, 0.0, 0.0);

    A3D_SetFriction(ramp, 0.0);

    return 1;
}

Related

  • A3D_SetBounce: Set how much a physics object bounces.
  • A3D_SetRollingFriction: Slow a moving physics object down by a constant amount, as a ball rolling on cloth.
  • A3D_SetDamping: Set how fast a moving physics object loses speed and spin on its own.

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