Skip to content

A3D_SetAcceleration

imshooter edited this page Oct 17, 2026 · 1 revision

Push a moving physics object with a constant acceleration until it is set to zero.

native bool:A3D_SetAcceleration(Physic:physicid, Float:ax, Float:ay, Float:az);

Parameters

Parameter Description
Physic:physicid Physics object to push.
Float:ax Acceleration on the X axis, in metres per second squared.
Float:ay Acceleration on the Y axis.
Float:az Acceleration on the Z axis.

Returns

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

Remarks

The acceleration is applied on every step, on top of the gravity, until it is set to 0.0, 0.0, 0.0. It acts as a force of the mass times the acceleration, so every object reaches the same acceleration whatever its mass. An accelerated object never comes to rest.

It suits wind, a conveyor belt or a rocket.

Example

Blows a balloon away to the east.

stock Physic:LaunchBalloon(Float:x, Float:y, Float:z) {
    new Physic:balloon = A3D_CreateSphere(-1, 0.4, x, y, z, 0.1);

    A3D_SetGravity(balloon, -0.5);
    A3D_SetAcceleration(balloon, 1.5, 0.0, 0.0);

    return balloon;
}

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