Skip to content

A3D_ApplyImpulse

imshooter edited this page Oct 17, 2026 · 1 revision

Push a moving physics object through its centre of mass.

native bool:A3D_ApplyImpulse(Physic:physicid, Float:x, Float:y, Float:z);

Parameters

Parameter Description
Physic:physicid Physics object to push.
Float:x Impulse on the X axis, in kilograms times metres per second.
Float:y Impulse on the Y axis.
Float:z Impulse on the Z axis.

Returns

  • true when the impulse was applied.
  • false when physicid is not a moving physics object.

Remarks

An impulse changes the velocity by the impulse divided by the mass, so the same push throws a light ball far and barely moves a heavy crate. An impulse of 10.0 gives a ball of half a kilogram 20 metres per second and a crate of 20 kilograms half a metre per second.

The push goes through the centre of mass, so it adds no spin. It wakes the object.

Example

A punch that pushes whatever object it hits.

stock Punch(playerid, Physic:physicid) {
    new
        Float:angle
    ;

    GetPlayerFacingAngle(playerid, angle);
    A3D_ApplyImpulse(physicid, -floatsin(angle, degrees) * 40.0, floatcos(angle, degrees) * 40.0, 10.0);
}

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