Skip to content

A3D_SetSyncError

imshooter edited this page Oct 18, 2026 · 2 revisions

Set how far the object players see may stray from the body before a new move is sent.

It bounds the rotation too: the object may turn away from the body by the angle that moves its far end by that distance. Small objects that must look exact, such as pool balls, need a small value. Every update sent costs a packet for each player who sees the object.

native bool:A3D_SetSyncError(Physic:physicid, Float:error);

Parameters

Parameter Description
Physic:physicid Physics object to change.
Float:error Distance in metres. Starts at 3dandreas.sync_error.

Returns

  • true when the distance was set.
  • false when physicid is not a moving physics object, or error is not positive.

Remarks

The component works out where players see each object from the last move it sent. A new move is sent when that place strays from the body by more than this distance, when the rotation of the object turns its far end away by more than this distance, or when the last move has run its course while the body still moves. An object that falls asleep glides to where it rests in a tenth of a second. The default, 3dandreas.sync_error, is 0.1 metres, which suits objects a player does not watch closely. The balls of models.json take 0.03, and a pool ball needs about 0.02.

Each update reaches every player who sees the object, and a small error sends updates more often. A3D_GetStats counts them. See Physics objects.

Example

stock Physic:CreateCueBall(Float:x, Float:y, Float:z) {
    new Physic:ball = A3D_CreateSphere(3003, 0.04, x, y, z, 0.17);

    A3D_SetSyncError(ball, 0.02);

    return ball;
}

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