{"name":"drawLine3D","operator":null,"title":"drawLine3D","type":"command","url":"https://community.bistudio.com/wiki/drawLine3D","revid":377395,"updated":"2026-01-02T06:44:42Z","groups":["Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Draws a line of a given colour between two 3D positions in the current frame. To be used mostly in a \"Draw3D\" mission event handler.","syntaxes":[{"syntax":"drawLine3D [start, end, color, width]","since":null,"effect":null,"exec":null,"params":[{"name":"start","type":"PositionAGL","optional":false,"default":null,"description":null,"types":["PositionAGL"],"since":null,"text":"start: PositionAGL"},{"name":"end","type":"PositionAGL","optional":false,"default":null,"description":null,"types":["PositionAGL"],"since":null,"text":"end: PositionAGL"},{"name":"color","type":null,"optional":false,"default":null,"description":"Color (RGBA)","types":["Color"],"since":null,"text":"color: Color (RGBA)"},{"name":"width","type":"Number","optional":true,"default":"3","description":null,"types":["Number"],"since":"arma3 2.18","text":"width: Number - (Optional, default 3)"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"[start, end, color, width]","types":["Array"]}}],"examples":[{"text":"```sqf\nonEachFrame {\n    drawLine3D [getPos player, getPos cursorTarget, [1,1,1,1]];\n};\n```","code":["onEachFrame {\n\tdrawLine3D [getPos player, getPos cursorTarget, [1,1,1,1]];\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["drawIcon3D","ASLToAGL"],"notes":[{"user":"Killzone_Kid","date":"2013-08-31T09:27:00Z","text":"As the command syntax indicates, this command expects starting and ending position in format PositionAGL meaning that over the land it expects PositionATL and over the sea PositionASLW. Use additional ASLToAGL and AGLToASL commands wherever is necessary.\n\n```sqf\naddMissionEventHandler [\"Draw3D\", {\n    drawLine3D [ASLToAGL eyePos soldier1, ASLToAGL eyePos soldier2, [1,0,0,1]];\n}];\n```"},{"user":"Waffle SS.","date":"2015-02-18T02:10:00Z","text":"Visible through fog and past draw distance."},{"user":"fusselwurm","date":"2021-11-25T21:37:10Z","text":"Caveat: lines invisible through MH-9 helicopter windows, see https://feedback.bistudio.com/T66225"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Introduced with Arma 3 version 0.50","Scripting Commands","Scripting Commands: Local Effect"]}