{"name":"BIS_fnc_vectorFromXToY","title":"BIS fnc vectorFromXToY","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_vectorFromXToY","revid":352158,"updated":"2024-02-01T23:25:22Z","groups":["Vectors"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Returns a unit vector that 'points' from *vector1* to *vector2*.\nThis is a very useful function as it can be used with the velocity command to move an object from one position to another (i.e *vector1* to *vector2*).\n\n> [!NOTE]\n> Ensure both positions are found using getPosASL.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.26 For better performance, use the vectorFromTo command instead.","syntaxes":[{"syntax":"[vector1, vector2] call BIS_fnc_vectorFromXToY","params":[{"name":"vector1","type":"Array","type_expr":"Array"},{"name":"vector2","type":"Array","type_expr":"Array"}],"returns":{"type":"Array","type_expr":"Array"}}],"examples":[{"code":["private _resultVector = [getPosASL vehicle player, getPosASL airTarget] call BIS_fnc_vectorFromXToY;"]}],"see_also":["velocity","setVelocity","vectorAdd"]}