Skip to content

A3D_SetCollisionSpeed

imshooter edited this page Oct 17, 2026 · 1 revision

Set the slowest impact of a moving physics object that calls A3D_OnCollided.

native bool:A3D_SetCollisionSpeed(Physic:physicid, Float:speed);

Parameters

Parameter Description
Physic:physicid Physics object to change.
Float:speed Speed in metres per second. Starts at 3dandreas.collision_speed.

Returns

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

Remarks

The speed of an impact is the speed at which both bodies approach each other along the line of the contact. A ball that rolls on the ground has an impact speed near zero, and one that falls on it has its falling speed. 0.0 calls A3D_OnCollided for every new contact in which the bodies move towards each other.

Example

Reports only the hard hits of a wrecking ball.

stock Physic:CreateWreckingBall(Float:x, Float:y, Float:z) {
    new Physic:ball = A3D_CreateSphere(-1, 1.0, x, y, z, 500.0);

    A3D_SetCollisionSpeed(ball, 4.0);

    return ball;
}

Related

  • A3D_OnCollided: A moving physics object hit something faster than its collision speed.
  • A3D_SetCollisions: Choose what a moving physics object collides with.

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