{"name":"BIS_fnc_vectorFromXToY","operator":null,"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","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"vector1","type":"Array","optional":false,"default":null,"description":null,"types":["Array"],"since":null,"text":"vector1: Array"},{"name":"vector2","type":"Array","optional":false,"default":null,"description":null,"types":["Array"],"since":null,"text":"vector2: Array"}],"returns":{"type":"Array","types":["Array"],"description":null,"text":"Array"}}],"examples":[{"text":"```sqf\nprivate _resultVector = [getPosASL vehicle player, getPosASL airTarget] call BIS_fnc_vectorFromXToY;\n```","code":["private _resultVector = [getPosASL vehicle player, getPosASL airTarget] call BIS_fnc_vectorFromXToY;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["velocity","setVelocity","vectorAdd"],"notes":[],"categories":["Arma 2: Functions","Arma 2: New Functions","Arma 2: Operation Arrowhead: Functions","Arma 3: Functions","Function Group: Vectors","Functions","Introduced with Arma 2 version 1.00","Take On Helicopters: Functions"],"docblock":null,"filled_from_docblock":[]}