Arma 3 Scripting

Function in Vectors

BIS_fnc_unitVector

Also available as Markdown and JSON, or read the original wiki page.

Description

Unit Vector

Returns the unit vector for the passed vector (vector pointing in the same direction, but with magnitude == 1) This does not modify the original array. The array can have any number of elements (2, 3, etc).

Syntax

Returns:

Function header

The comment at the top of the function's file in the game; this page's description come from it.

/*
    Unit Vector

Returns the unit vector for the passed vector (vector pointing
in the same direction, but with magnitude == 1)
This does not modify the original array.
The array can have any number of elements (2, 3, etc).
*/