{"name":"getRelDir","operator":null,"title":"getRelDir","type":"command","url":"https://community.bistudio.com/wiki/getRelDir","revid":364385,"updated":"2024-05-12T02:06:56Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.56"}],"since":{"game":"arma3","name":"Arma 3","version":"1.56"},"arma3_since":"1.56","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"description":"Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of BIS_fnc_relativeDirTo.\nTaking the current direction of the object into account.","syntaxes":[{"syntax":"object getRelDir position","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"position","type":"Object, Position2D or Position3D","optional":false,"default":null,"description":null,"types":["Object","Position2D","Position3D"],"since":null,"text":"position: Object, Position2D or Position3D"}],"returns":{"type":"Number","types":["Number"],"description":null,"text":"Number"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"position","types":["Object","Position2D","Position3D"]}}],"examples":[{"text":"```sqf\n_reldir = player getRelDir tank;\n```","code":["_reldir = player getRelDir tank;"]},{"text":"```sqf\n// Set object's direction towards any given position\n_object setDir (getDir _object + (_object getRelDir [_x, _y, _z]))\n```","code":["// Set object's direction towards any given position\n_object setDir (getDir _object + (_object getRelDir [_x, _y, _z]))"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["getDir","direction","getDirVisual"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Arma 3 version 1.56","Scripting Commands"]}