{"name":"getRelPos","operator":null,"title":"getRelPos","type":"command","url":"https://community.bistudio.com/wiki/getRelPos","revid":377397,"updated":"2026-01-02T06:44:48Z","groups":["Positions"],"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 position that is given distance and relative direction away from original object. The alternative syntax available from Arma 3 v 2.14, returns the position offset of the attached object. If the animated memory point is used for attachment, the offset is calculated in render scope.","syntaxes":[{"syntax":"object getRelPos [distance, direction]","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":"object","types":["Object"],"since":null,"text":"object: Object - object"},{"name":"distance","type":"Number","optional":false,"default":null,"description":"distance from object","types":["Number"],"since":null,"text":"distance: Number - distance from object"},{"name":"direction","type":"Number","optional":false,"default":null,"description":"direction relative to object's current direction","types":["Number"],"since":null,"text":"direction: Number - direction relative to object's current direction"}],"returns":{"type":"PositionAGL","types":["PositionAGL"],"description":null,"text":"PositionAGL"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"[distance, direction]","types":["Array"]}},{"syntax":"obj1 getRelPos obj2","since":"arma3 2.14","effect":null,"exec":null,"params":[{"name":"obj1","type":"Object","optional":false,"default":null,"description":"parent object","types":["Object"],"since":null,"text":"obj1: Object - parent object"},{"name":"obj2","type":"Object","optional":false,"default":null,"description":"attached object","types":["Object"],"since":null,"text":"obj2: Object - attached object"}],"returns":{"type":"PositionRelative","types":["PositionRelative"],"description":null,"text":"PositionRelative"},"form":"binary","operator":null,"left":{"text":"obj1","types":["Object"]},"right":{"text":"obj2","types":["Object"]}}],"examples":[{"text":"Find position 100 metres away at player's 3 o'clock:\n\n```sqf\n_relpos = player getRelPos [100, 90];\n```","code":["_relpos = player getRelPos [100, 90];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["getPos","getPosASLVisual","getPosATLVisual","visiblePositionASL","visiblePosition","position","getPosATL","getPosASL","getPosASLW"],"notes":[{"user":"talkingtoaj","date":"2016-03-03T15:53:00Z","text":"getPos vs getRelPos: getRelPos operates similarly to getPos except in getRelPos the direction is calculated 'relative' to the current object direction whereas getPos's direction is from North. Thus while getPos can take a position array as it is starting point, getRelPos requires an object with its own azimut heading."}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Positions","Introduced with Arma 3 version 1.56","Scripting Commands"]}