velocity: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Added to "see also" + <code> tidy)
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| ofpr |= Game name
| ofpr |Game name=


|1.8|= Game version
|1.80|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Return velocity (speed vector) of [[Object#Unit|Unit]] as an array with format [x, z, y]. Units are in metres per second. |= Description
| Return velocity (speed vector) of [[Object#Unit|Unit]] as an array with format [x, y, z].
{{Important|Units are in metres per second.}} |Description=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[Array]] <nowiki>=</nowiki> '''velocity''' vehicleName |= Syntax
| [[velocity]] vehicleName |Syntax=


|p1= vehicleName: [[Object]] |= Parameter 1
|p1= vehicleName: [[Object]] |Parameter 1=


| [[Array]] |= Return value
| [[Array]] |Return value=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>vector = [[velocity]] jeep;</code> |= Example 1
|x1= <code>_vector = [[velocity]] jeep;</code> |Example 1=
|x2= <code>? ([[velocity]] _plane1 [[select]] 2) > 50 : [[hint]] "Aircraft is climbing up too fast!";</code> |= Example 2
|x2= <code>[[if]] (([[velocity]] _plane1 [[select]] 2) > 50) [[then]] { [[hint]] "Aircraft is climbing up too fast!"; };</code> |Example 2=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[velocityModelSpace]],  
| [[setVelocity]], [[velocityModelSpace]], [[setVelocityModelSpace]], [[setVelocityTransformation]], [[speed]] |See also=
[[setVelocity]],  
[[setVelocityTransformation]] |= See also
 
}}
}}


Line 36: Line 34:
<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>


[[Category:Scripting Commands|VELOCITY]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|VELOCITY]]
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|VELOCITY]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|VELOCITY]]
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Revision as of 18:55, 10 January 2020

Hover & click on the images for description

Description

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

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

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section