velocity: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
(32 intermediate revisions by 17 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|V]]
{{Command|Comments=
[[Category:Scripting Commands OFP 1.97|V]]
____________________________________________________________________________________________
[[Category:Scripting Commands ArmA|V]]


| 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'''
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Description:'''
<!-- Note Section END -->
</dl>


Return velocity (speed vector) of vehicle as array '''[x, z, y]'''.
<h3 style="display:none">Bottom Section</h3>


 
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
'''Example:'''
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
? '''velocity''' carOne > 50 : [[hint]] "Slow down, you are exceeding the speed limit."
[[Category:Scripting Commands Armed Assault|{{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}}}}]]

Revision as of 10:27, 23 September 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:
Object Manipulation

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