velocity: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (fixed example)
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(38 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofpr |= Game name
| ofpr


|1.8|= Game version
|1.80
____________________________________________________________________________________________


| Return velocity (speed vector) of vehicle as array [x, z, y]. |= Description
|gr1= Object Manipulation
____________________________________________________________________________________________


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


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


| [[Array]] |= Return value
|p1= vehicleName: [[Object]]
____________________________________________________________________________________________
 
| [[Array]]
   
   
|x1= <code>vector <nowiki>=</nowiki> velocity jeep Advanced: _vehicle [[setVelocity]] [(velocity _vehicle select 0)+([[sin]] _dir*_speed),(velocity _vehicle select 1)+([[cos]] _dir*_speed),(velocity _vehicle select 2)]</code> |= Example 1
|x1= <code>_vector = [[velocity]] jeep;</code>
____________________________________________________________________________________________
|x2= <code>[[if]] (([[velocity]] _plane1 [[select]] 2) > 50) [[then]] { [[hint]] "Aircraft is climbing up too fast!"; };</code>
 
|  |= See also


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


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<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}}}}]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
{{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