Skip to content

A3D_SetRollingFriction

imshooter edited this page Oct 17, 2026 · 1 revision

Slow a moving physics object down by a constant amount, as a ball rolling on cloth.

Only the speed along the ground is reduced. It adds to the friction and the damping.

native bool:A3D_SetRollingFriction(Physic:physicid, Float:deceleration);

Parameters

Parameter Description
Physic:physicid Physics object to change.
Float:deceleration Speed lost per second, in metres per second squared. Starts at 0.0.

Returns

  • true when the friction was set.
  • false when physicid is not a moving physics object, or deceleration is negative.

Remarks

The friction of a contact only resists sliding. A ball that rolls without slipping keeps rolling for ever unless something slows it down, and the damping slows fast balls far more than slow ones. A rolling friction takes the same speed every second, as a ball on cloth or grass that rolls a while and then stops.

Only the speed along the ground is reduced, and the spin with it. It also acts while the object flies, so it suits objects that stay on the ground.

Example

A pool ball that stops after a few seconds of rolling.

stock Physic:CreatePoolBall(modelid, Float:x, Float:y, Float:z) {
    new Physic:ball = A3D_CreateSphere(modelid, 0.04, x, y, z, 0.17);

    A3D_SetRollingFriction(ball, 0.3);
    A3D_SetPlanar(ball);
    A3D_SetSyncError(ball, 0.02);

    return ball;
}

Related

  • A3D_SetFriction: Set how much a physics object grips what it touches.
  • A3D_SetDamping: Set how fast a moving physics object loses speed and spin on its own.
  • A3D_SetPlanar: Keep a moving physics object at its height, so it only moves along the ground.

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