{"name":"findEmptyPosition","operator":null,"title":"findEmptyPosition","type":"command","url":"https://community.bistudio.com/wiki/findEmptyPosition","revid":377837,"updated":"2026-01-03T04:32:18Z","groups":["Positions"],"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":"Searches for an empty area around the specified position, starting from the *center* looking for an empty *areaRadius* and looks as far away as *areaRadius* + *maxDistance*.\nThis command ignores moving objects present within the search area. The search area can be preloaded with findEmptyPositionReady command.\n\n> [!NOTE]\n> This command does not work outside of world dimensions and will always return the provided *center*.\n> Objects outside the world dimensions will not be considered in the detection either.","syntaxes":[{"syntax":"center findEmptyPosition [areaRadius, maxDistance, vehicleType]","since":null,"effect":null,"exec":null,"params":[{"name":"center","type":"Position2D or Position3D","optional":false,"default":null,"description":"search area center position in format [x,y] or [x,y,z] in which case z is ignored","types":["Position2D","Position3D"],"since":null,"text":"center: Position2D or Position3D - search area center position in format [x,y] or [x,y,z] in which case z is ignored"},{"name":"areaRadius","type":"Number","optional":false,"default":null,"description":"wanted area radius","types":["Number"],"since":null,"text":"areaRadius: Number - wanted area radius"},{"name":"maxDistance","type":"Number","optional":false,"default":null,"description":"stop searching no further than `areaRadius + maxDistance` from the center","types":["Number"],"since":null,"text":"maxDistance: Number - stop searching no further than `areaRadius + maxDistance` from the center"},{"name":"vehicleType","type":"String","optional":true,"default":null,"description":"classname of a vehicle to accommodate","types":["String"],"since":null,"text":"vehicleType: String - (Optional) classname of a vehicle to accommodate"}],"returns":{"type":"Position3D","types":["Position3D"],"description":"a suitable empty position or empty array `[]` if not found","text":"Position3D - a suitable empty position or empty array `[]` if not found"},"form":"binary","operator":null,"left":{"text":"center","types":["Position2D","Position3D"]},"right":{"text":"[areaRadius, maxDistance, vehicleType]","types":["Array"]}}],"examples":[{"text":"```sqf\n_position = getPosASL player findEmptyPosition [0, 100];\n```","code":["_position = getPosASL player findEmptyPosition [0, 100];"]},{"text":"```sqf\n_position = _center findEmptyPosition [10,100,\"UH60M_EP1\"];\n```","code":["_position = _center findEmptyPosition [10,100,\"UH60M_EP1\"];"]},{"text":"Check if exact position is empty:\n\n```sqf\n_position = _center findEmptyPosition [0, 0, \"B_Boat_Armed_01_minigun_F\"];\n```","code":["_position = _center findEmptyPosition [0, 0, \"B_Boat_Armed_01_minigun_F\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["findEmptyPositionReady","selectBestPlaces","isFlatEmpty","BIS_fnc_findSafePos"],"notes":[{"user":"Killzone_Kid","date":"2013-11-06T18:10:00Z","text":"Keep search radius short and sweet, under 50 metres maybe. Searching big area takes long time and will result in your game stop responding until the search is over. isFlatEmpty is probably more suitable for a larger area search."},{"user":"old_man_auz","date":"2012-03-06T00:50:00Z","text":"I think the **radius** parameter should be treated as a 'minimum distance' from the **centre** position. I found that the parameter name **radius** was not very clear. Also, if **radius** is greater than **max distance** then the function will always return an empty array.\n\nHere is an snippet of code I use to find a safe landing zone for an extraction helicopter. It may be useful for someone.\n\n```sqf\n_centre = [getMarkerPos \"marker\", random 150, random 360] call BIS_fnc_relPos;\n_extraction_point = [];\n_max_distance = 100;\nwhile { count _extraction_point < 1 } do\n{\n    _extraction_point = _centre findEmptyPosition [30, _max_distance, \"UH60M_EP1\"];\n    _max_distance = _max_distance + 50;\n};\n```\n\nIn the above example, make sure that \"_max_distance\" is greater than 30, otherwise the while loop will go forever."}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Positions","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}