Difference between revisions of "velocity"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "")
 
(41 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands]]
+
{{Command|Comments=
[[Category:Scripting Commands OFP 1.97]]
 
[[Category:Scripting Commands ArmA]]
 
  
back to [[Scripting_Reference#V|COMREF]]
+
| ofpr |Game name=
  
<h2 style="color:#000066">'''velocity ''vehicle'''''</h2>
+
|1.80|Game version=
  
 +
|gr1= Object Manipulation |GROUP1=
  
'''Operand types:'''
+
| Return velocity (speed vector) of [[Object#Unit|Unit]] as an array with format [x, y, z].
 +
{{Important|Units are in metres per second.}} |Description=
  
'''vehicle:''' [[Object]]
+
| [[velocity]] vehicleName |Syntax=
  
'''Type of returned value:'''
+
|p1= vehicleName: [[Object]] |Parameter 1=
  
[[Array]]
+
| [[Array]] |Return value=
 +
 
 +
|x1= <code>_vector = [[velocity]] jeep;</code> |Example 1=
 +
|x2= <code>[[if]] (([[velocity]] _plane1 [[select]] 2) > 50) [[then]] { [[hint]] "Aircraft is climbing up too fast!"; };</code> |Example 2=
  
'''Compatibility:'''
+
|  [[setVelocity]], [[velocityModelSpace]], [[setVelocityModelSpace]], [[setVelocityTransformation]], [[speed]] |See also=
 +
}}
  
Added in version '''1.80'''
 
  
'''Description:'''
+
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
+
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
Return velocity (speed vector) of vehicle as array '''[x, z, y]'''.
+
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
 
+
{{GameCategory|arma1|Scripting Commands}}
 
+
{{GameCategory|arma2|Scripting Commands}}
'''Example:'''
+
{{GameCategory|arma2|Scripting Commands}}
 
+
{{GameCategory|tkoh|Scripting Commands}}
? '''velocity''' carOne > 50 : [[hint]] "Slow down, you are exceeding the speed limit."
+
{{GameCategory|arma3|Scripting Commands}}

Latest revision as of 02:58, 18 January 2021

Introduced with Operation Flashpoint: Resistance version 1.801.80
Hover & click on the images for descriptions

Description

Description:
Return velocity (speed vector) of Unit as an array with format [x, y, z].
Units are in metres per second.

Syntax

Syntax:
velocity vehicleName
Parameters:
vehicleName: Object
Return Value:
Array

Examples

Example 1:
_vector = velocity jeep;
Example 2:
if ((velocity _plane1 select 2) > 50) then { hint "Aircraft is climbing up too fast!"; };

Additional Information

See also:
setVelocityvelocityModelSpacesetVelocityModelSpacesetVelocityTransformationspeed
Groups:
Object Manipulation

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.