Skip to content

A3D_SetCollisions

imshooter edited this page Oct 17, 2026 · 1 revision

Choose what a moving physics object collides with.

Zones see it whatever is chosen.

native bool:A3D_SetCollisions(Physic:physicid, A3D_COLLIDE:flags);

Parameters

Parameter Description
Physic:physicid Physics object to change.
A3D_COLLIDE:flags What it collides with, A3D_COLLIDE_ALL by default.

Returns

  • true when it was changed.
  • false when physicid is not a moving physics object.

Remarks

Two bodies collide only when each collides with what the other is. Players, vehicles, actors, static objects and the map collide with everything, so the flags of a moving object decide alone. Two moving objects collide when both hold A3D_COLLIDE_OBJECTS.

A3D_COLLIDE_WATER has no effect here. Objects never collide with the water and float with A3D_SetBuoyancy. Zones see an object whatever its flags. See Collision flags.

Example

A ball that passes through players and vehicles but bounces off the map and other balls.

stock Physic:CreateGhostBall(Float:x, Float:y, Float:z) {
    new Physic:ball = A3D_CreateSphere(1598, 0.3, x, y, z, 0.5);

    A3D_SetCollisions(ball, A3D_COLLIDE_MAP | A3D_COLLIDE_STATIC | A3D_COLLIDE_OBJECTS);

    return ball;
}

Related

  • A3D_GetCollisions: What a moving physics object collides with.
  • A3D_SetCollisionSpeed: Set the slowest impact of a moving physics object that calls A3D_OnCollided.
  • A3D_SetWorld: Move a physics object, a static object or a zone to another virtual world.

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
Callbacks

Clone this wiki locally