Arma 3 Scripting

Command in Object Manipulation

setVelocity

Also available as Markdown and JSON, or read the original wiki page.

Description

Sets velocity vector of an object in m/s.

Important

Since Arma 3 v2.06 each velocity component is limited to the range +-5000 m/s.

Syntax

object setVelocity vector

Parameters:

Returns: Nothing

Examples

Example 1

_truck1 setVelocity [20, 0, 0];

Example 2

Advanced method used for relative acceleration:

_vel = velocity _vehicle;
_dir = getDir _vehicle;
_additionalSpeed = 10; // in m/s
_vehicle setVelocity [
    (_vel select 0) + (sin _dir * _additionalSpeed), 
    (_vel select 1) + (cos _dir * _additionalSpeed), 
    (_vel select 2) // horizontal only
];

See also

velocity · velocityModelSpace · setVelocityModelSpace · setVelocityTransformation · speed

Community notes