{"name":"terrainIntersect","operator":null,"title":"terrainIntersect","type":"command","url":"https://community.bistudio.com/wiki/terrainIntersect","revid":377407,"updated":"2026-01-02T06:45:07Z","groups":["Math - Geometry"],"status":"ok","replaced_by":[],"games":[{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.62"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.62"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Checks for intersection of terrain between two AGL positions. Returns true if intersects with terrain. For ASL variant see terrainIntersectASL.","syntaxes":[{"syntax":"terrainIntersect [start, end]","since":null,"effect":null,"exec":null,"params":[{"name":"start","type":"PositionAGL","optional":false,"default":null,"description":"start position","types":["PositionAGL"],"since":null,"text":"start: PositionAGL - start position"},{"name":"end","type":"PositionAGL","optional":false,"default":null,"description":"end position","types":["PositionAGL"],"since":null,"text":"end: PositionAGL - end position"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"unary","operator":null,"left":null,"right":{"text":"[start, end]","types":["Array"]}}],"examples":[{"text":"```sqf\n_intersects = terrainIntersect [getPos player, getPos chopper];\n```","code":["_intersects = terrainIntersect [getPos player, getPos chopper];"]},{"text":"```sqf\n_intersects = terrainIntersect [position player, position enemy1];\n```","code":["_intersects = terrainIntersect [position player, position enemy1];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["terrainIntersectAtASL","lineIntersectsSurfaces","intersect","lineIntersects","lineIntersectsWith","terrainIntersectASL","lineIntersectsObjs","checkVisibility"],"notes":[{"user":"Lou Montana","date":"2012-05-31T10:40:00Z","text":"Please note the difference:\n- terrainIntersect\n- terrainIntersectASL\n- lineIntersect***s***\n- lineIntersect***s***With\n- lineIntersect***s***Objs\n- intersect"},{"user":"Rocket","date":"2012-06-01T15:55:00Z","text":"This command is CPU intensive on the engine, be careful with its use."},{"user":"Dwarden","date":"2012-06-23T17:15:00Z","text":"This command was changed to ATL and counterpart for ASL was added in build 94049."}],"categories":["Arma 2: Operation Arrowhead: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 3: Scripting Commands","Command Group: Math - Geometry","Introduced with Arma 2: Operation Arrowhead version 1.62","Scripting Commands","Take On Helicopters: Scripting Commands"]}