Skip to content

A3D_SetRotation

imshooter edited this page Oct 17, 2026 · 1 revision

Turn a physics object to a new rotation at once.

native bool:A3D_SetRotation(Physic:physicid, Float:rx, Float:ry, Float:rz);

Parameters

Parameter Description
Physic:physicid Physics object to turn.
Float:rx Rotation on the X axis.
Float:ry Rotation on the Y axis.
Float:rz Rotation on the Z axis.

Returns

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

Remarks

The rotation is that of SetObjectRot, in degrees. The object turns at once and players see it turned at once. The spin is kept and a moving object wakes up.

Example

Stands a fallen crate upright again.

stock StandUp(Physic:crate) {
    new
        Float:rx,
        Float:ry,
        Float:rz
    ;

    A3D_GetRotation(crate, rx, ry, rz);
    A3D_SetRotation(crate, 0.0, 0.0, rz);
}

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