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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


Introduced in

Version:1.00

Description

Description: Set velocity (speed vector) of a vehicle. Units are in meters per second.

Syntax

Syntax: vehicle setVelocity [x, y, z]
Parameters:
  • vehicle: Object
  • [x, y, z]: Vector3D - Acceleration in [x,y,z]. V2.15+: [0,0,0] will stop 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.

  • No labels