velocity: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Velocity used in example would have errored, as it returns an array and not a number)
mNo edit summary
Line 1: Line 1:
[[Category:Scripting Commands|VELOCITY]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.96|VELOCITY]]
____________________________________________________________________________________________
[[Category:Scripting Commands ArmA|VELOCITY]]


| ofpr |= Game name


<h2 style="color:#000066">'''velocity ''vehicle'''''</h2>
|1.8|= Game version
____________________________________________________________________________________________


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


'''Operand types:'''
| '''velocity''' vehicle |= Syntax


'''vehicle:''' [[Object]]
|p1= vehicle: [[Object]] |= Parameter 1


'''Type of returned value:'''
| [[Array]] |= Return value
____________________________________________________________________________________________
 
|x1= <pre>vector = velocity jeep Advanced: _vehicle setVelocity [(velocity _vehicle select 0)+(sin _dir*_speed),(velocity _vehicle select 1)+(cos _dir*_speed),(velocity _vehicle select 2)]</pre> |= Example 1
____________________________________________________________________________________________


[[Array]]
|  |= See also


'''Compatibility:'''
}}


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|VELOCITY]]
'''Example:'''
[[Category:Scripting Commands OFP 1.96|VELOCITY]]
 
[[Category:Scripting Commands ArmA|VELOCITY]]
vector = '''velocity''' jeep
 
'''Advanced:'''
 
_vehicle setVelocity [('''velocity''' _vehicle select 0)+(sin _dir*_speed),('''velocity''' _vehicle select 1)+(cos _dir*_speed),('''velocity''' _vehicle select 2)]

Revision as of 22:48, 1 August 2006

Hover & click on the images for description

Description

Description:
Return velocity (speed vector) of vehicle as array [x, z, y].
Groups:
Uncategorised

Syntax

Syntax:
velocity vehicle
Parameters:
vehicle: Object
Return Value:
Array

Examples

Example 1:
vector = velocity jeep Advanced: _vehicle setVelocity [(velocity _vehicle select 0)+(sin _dir*_speed),(velocity _vehicle select 1)+(cos _dir*_speed),(velocity _vehicle select 2)]

Additional Information

See also:
See also needed

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