velocity: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| ofpr |Game name=
| ofpr |Game name=
Line 7: Line 6:


|gr1= Object Manipulation |GROUP1=
|gr1= Object Manipulation |GROUP1=
____________________________________________________________________________________________


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


| [[velocity]] vehicleName |Syntax=
| [[velocity]] vehicleName |Syntax=
Line 18: Line 15:


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


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

Revision as of 04:22, 17 January 2021

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