{"name":"getRelDir","title":"getRelDir","type":"command","url":"https://community.bistudio.com/wiki/getRelDir","revid":379349,"updated":"2026-10-30T23:54:42Z","groups":["Object Manipulation"],"status":"ok","games":{"arma3":"1.56"},"since":"arma3 1.56","arma3_since":"1.56","locality":{"argument":"global"},"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","params":[{"name":"object","type":"Object","type_expr":"Object"},{"name":"position","type":"Object, Position2D or Position3D","type_expr":"Object | Position2D | Position3D"}],"returns":{"type":"Number","type_expr":"Number"},"form":"binary","left":{"text":"object"},"right":{"text":"position"}}],"examples":[{"code":["_reldir = player getRelDir tank;"]},{"code":["// Set object's direction towards any given position\n_object setDir (getDir _object + (_object getRelDir [_x, _y, _z]))"]}],"see_also":["getDir","direction","getDirVisual"],"notes":[{"user":"Tankbuster","date":"2018-08-07T21:50:00Z","text":"To clarify, this returns a relative direction, so objects directly in front are said to be at zero degrees. So, taking example 1 above, if the tank is in front of the player, this function will return 0. If the tank is to the right of the player, it will return 90."}]}