Difference between revisions of "velocity"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Velocity used in example would have errored, as it returns an array and not a number)
Line 26: Line 26:
 
'''Example:'''
 
'''Example:'''
  
? '''velocity''' carOne > 50 : [[hint]] "Slow down, you are exceeding the speed limit."
+
vector = '''velocity''' jeep
 +
 
 +
'''Advanced:'''
 +
 
 +
_vehicle setVelocity [('''velocity''' _vehicle select 0)+(sin _dir*_speed),('''velocity''' _vehicle select 1)+(cos _dir*_speed),('''velocity''' _vehicle select 2)]

Revision as of 21:52, 18 July 2006


velocity vehicle


Operand types:

vehicle: Object

Type of returned value:

Array

Compatibility:

Added in version 1.80

Description:

Return velocity (speed vector) of vehicle as array [x, z, y].


Example:

vector = velocity jeep

Advanced:

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