{"name":"inArea","title":"inArea","type":"command","url":"https://community.bistudio.com/wiki/inArea","revid":377541,"updated":"2026-01-02T06:54:31Z","groups":["Triggers","Markers","Locations","Positions"],"status":"ok","games":{"arma3":"1.58"},"since":"arma3 1.58","arma3_since":"1.58","description":"Checks whether given position or object is inside given area. Use inAreaArray to check multiple positions/objects within area.\n\n> [!IMPORTANT]\n> By default all positions given as Array or as objects are treated as PositionAGL. Since Arma 3 v2.20 there is an option to force them to PositionWorld format.\n\n> [!NOTE]\n> This command also supports hexagon area which can be created from ellipse when both a and b are negative.\n> Hexagon ellipses are also supported by both marker creation and drawEllipse.","syntaxes":[{"syntax":"position inArea area","params":[{"name":"position","type":"Object or Position2D or Position3D (must be PositionAGL if area is checked in 3D)","type_expr":"Object | Position2D | Position3D | PositionAGL"},{"name":"area","type":"Object, String, Location","description":"Object, String, Location\n\n- Object - trigger\n- String - marker name\n- Location - location","type_expr":"Object | String | Location","text":"area: Object, String, Location\n\n- Object - trigger\n- String - marker name\n- Location - location"}],"returns":{"type":"Boolean","type_expr":"Boolean"},"form":"binary","left":{"text":"position"},"right":{"text":"area"}},{"syntax":"position inArea [center, a, b, angle, isRectangle, c, usePosWorld]","params":[{"name":"position","description":"Object and/or Position to check. Position must be PositionAGL if area is checked in 3D (see note in description)","type_expr":"Object | Position","text":"position: - Object and/or Position to check. Position must be PositionAGL if area is checked in 3D (see note in description)"},{"name":"center","type":"Array or Object","description":"center of the area in format Position2D, Position3D (must be PositionAGL if area is checked in 3D), Object or Group","type_expr":"Array | Object"},{"name":"a","type":"Number","description":"x axis (x / 2)","type_expr":"Number"},{"name":"b","type":"Number","description":"y axis (y / 2)","type_expr":"Number"},{"name":"angle","type":"Number","optional":true,"default":"0","description":"rotation angle","type_expr":"Number","optional_since":"arma3 2.20","text":"angle: Number - (Optional since 2.20, Default: 0) rotation angle"},{"name":"isRectangle","type":"Boolean","optional":true,"default":"false","description":"true if rectangle, false if ellipse","type_expr":"Boolean","optional_since":"arma3 2.20","text":"isRectangle: Boolean - (Optional since 2.20, Default: false) true if rectangle, false if ellipse"},{"name":"c","type":"Number","optional":true,"default":"-1 (unlimited)","description":"z axis (z / 2)","type_expr":"Number","since":"arma3 1.60","text":"c: Number - (Optional, default -1 (unlimited)) z axis (z / 2)"},{"name":"usePosWorld","type":"Boolean","optional":true,"default":"false","description":"set to true to treat all positions as PositionWorld","type_expr":"Boolean","since":"arma3 2.20","text":"usePosWorld: Boolean - (Optional, default false) set to true to treat all positions as PositionWorld"}],"returns":{"type":"Boolean","type_expr":"Boolean"},"form":"binary","left":{"text":"position"},"right":{"text":"[center, a, b, angle, isRectangle, c, usePosWorld]"}}],"examples":[{"code":["_playerIsInside = player inArea _myTrigger;"]},{"code":["_positionIsInside = _myPosition inArea [[100, 100, 0], 20, 30, 45, false];"]}],"see_also":["inAreaArray","triggerArea","in","inPolygon","drawEllipse","drawRectangle","createTrigger","createMarker","createLocation"]}