Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.00

Description

Description:Sets the velocity (speed vector) of a vehicle.

Syntax

Syntax:vehicle setVelocity velocity
Parameters:
  • vehicle: Object - Affected vehicle.
  • velocity: Vector3D - Velocity in [x, y ,z] (in V2.15+, [0,0,0] stops the vehicle).
Return Value:Nothing

Examples

Examples:
_truck1 setVelocity [20, 0, 0];

Advanced method used for relative acceleration:

_vel = velocity _vehicle;

_dir = direction _vehicle; _speed = 10; // Added speed;

_vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2)];

Additional Information

See also: velocity, setVelocityAng, setThrustWanted
Multiplayer:
Problems:

Notes





Posted on May 28, 2015
David Markwick
Will require a sleep of at least 1 frame between any positioning (including creation of, or otherwise moving with a setPos variant) and this command.