---
name: "intersect"
type: command
status: ok
groups: ["Math - Geometry"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/intersect
revid: 377413
updated: 2026-01-02T06:45:16Z
---

# intersect

*Command · Math - Geometry · Arma 3 v0.50 · introduced in Armed Assault v1.00*

Locality: arguments **global**

## Description

Finds named selections in object which are in specified LOD, intersected by given section of a line. Return value is in the form of [selection, distance]. Multiple returned arrays are nested within a single array. No intersection returns []. *lodName* could be one of the following:
- "FIRE"
- "VIEW"
- "GEOM"
- "IFIRE" - ("I" stands for Indirect, almost the same as FIRE)
- Arma 3 v2.02 "PHYSX" - PhysX geometry LOD

## Syntax

```sqf
[object, lodName] intersect [begPos, endPos]
```

**Parameters:**

- `object`: [Object](../topics/Object.md)
- `lodName`: [String](../topics/String.md)
- `begPos`: [PositionAGL](../topics/Position.md#positionagl)
- `endPos`: [PositionAGL](../topics/Position.md#positionagl)

**Returns:** [Array](../topics/Array.md) with [selection, distance]
- selection: [String](../topics/String.md) - name of intersected selection
- distance: [Number](../topics/Number.md) - distance from begPos
The results are also sorted, closest selection first

## Examples

### Example 1

```sqf
[_tank, "VIEW"] intersect [[1500, 1500, 2], [1550, 1500, 2]];
```

### Example 2

```sqf
sphere = "Sign_Sphere10cm_F" createVehicle [0,0,0];
onEachFrame {
    _begPos = positionCameraToWorld [0,0,0];
    _begPosASL = AGLToASL _begPos;
    _endPos = positionCameraToWorld [0,0,1000];
    _endPosASL = AGLToASL _endPos;
    _ins = lineIntersectsSurfaces [_begPosASL, _endPosASL, player, objNull, true, 1, "FIRE", "NONE"];
    if (_ins isEqualTo []) exitWith {sphere setPosASL [0,0,0]};
    _ins select 0 params ["_pos", "_norm", "_obj", "_parent"];
    if !(getModelInfo _parent select 2) exitWith {sphere setPosASL [0,0,0]};
    _ins2 = [_parent, "FIRE"] intersect [_begPos, _endPos];
    if (_ins2 isEqualTo []) exitWith {sphere setPosASL [0,0,0]};
    _ins2 select 0 params ["_name", "_dist"];
    _posASL = _begPosASL vectorAdd ((_begPosASL vectorFromTo _endPosASL) vectorMultiply _dist);
    drawIcon3D ["", [1,1,1,1], ASLToAGL _posASL, 0, 0, 0, _name, 1, 0.03, "PuristaMedium"];
    sphere setPosASL _posASL;
};
```

## See also

[lineIntersectsSurfaces](../commands/lineIntersectsSurfaces.md) · [terrainIntersect](../commands/terrainIntersect.md) · [terrainIntersectASL](../commands/terrainIntersectASL.md) · [terrainIntersectAtASL](../commands/terrainIntersectAtASL.md) · [lineIntersects](../commands/lineIntersects.md) · [lineIntersectsWith](../commands/lineIntersectsWith.md) · [lineIntersectsObjs](../commands/lineIntersectsObjs.md) · [cursorObject](../commands/cursorObject.md) · [cursorTarget](../commands/cursorTarget.md) · [checkVisibility](../commands/checkVisibility.md)

## Community notes

**ManDay** — 2007-07-25

The most common LOD is "*FIRE*", which identifies the most detailled hitbox used for ammunition.

---

**ffur2007slx2_5** — 2014-03-27

Example (In Arma 3 ver 1.14) display returned arrays on cursor entities:

```sqf
Sto = [];
Fn = {
    {
        Sto set [_foreachindex,[cursorTarget, _x] intersect [ASLToAGL eyePos player, screenToWorld [0.5,0.5]]];
    } foreach ["FIRE", "VIEW", "GEOM", "IFIRE"];
    hintSilent format ["FIRE: %1, VIEW: %2, GEOM: %3, IFIRE: %4", Sto select 0, Sto select 1, Sto select 2, Sto select 3];
};
["sample_id", "onEachFrame", "Fn"] call BIS_fnc_addStackedEventHandler;
```

Return FIRE: [something], VIEW: [something], GEOM: [something], IFIRE: [something].

---

**Killzone_Kid** — 2015-08-20

[intersect](../commands/intersect.md) will spam .rpt if passed to it object has no skeleton. Use [getModelInfo](../commands/getModelInfo.md) to filter out those objects.

<sub>Source: [BI Community Wiki — intersect](https://community.bistudio.com/wiki/intersect) (revision 377413).</sub>
