velocity: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(42 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|VELOCITY]]
{{RV|type=command
[[Category:Scripting Commands OFP 1.97|VELOCITY]]
[[Category:Scripting Commands ArmA|VELOCITY]]


| ofpr


<h2 style="color:#000066">'''velocity ''vehicle'''''</h2>
|1.80


|gr1= Object Manipulation


'''Operand types:'''
| Return velocity (speed vector) of [[Object#Unit|Unit]] as an array with format [x, y, z].
{{Feature|important|Units are in metres per second.}}


'''vehicle:''' [[Object]]
| [[velocity]] vehicleName


'''Type of returned value:'''
|p1= vehicleName: [[Object]]


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


'''Compatibility:'''
|seealso= [[setVelocity]], [[velocityModelSpace]], [[setVelocityModelSpace]], [[setVelocityTransformation]], [[speed]]
}}


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}}

Revision as of 01:15, 17 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Object Manipulation

Syntax

Syntax:
Syntax needed
Parameters:
vehicleName: Object
Return Value:
Return value needed

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