{"name":"drawLaser","operator":null,"title":"drawLaser","type":"command","url":"https://community.bistudio.com/wiki/drawLaser","revid":377735,"updated":"2026-01-03T00:22:18Z","groups":["Interaction","Lights"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.08"}],"since":{"game":"arma3","name":"Arma 3","version":"2.08"},"arma3_since":"2.08","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Draws a laserbeam and a lightpoint at the impact location of the laser.\n\nThis command has to be executed every frame - see Arma 3: Mission Event Handlers#Draw3D.\n\nLasers drawn with this command are subject to the same limitations as weapon attachment lasers. These limitations are defined in the `CfgIRLaserSettings` config class.","syntaxes":[{"syntax":"drawLaser [position, direction, beamColor, dotColor, dotSize, beamThickness, beamMaxLength, isIR]","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":"PositionASL","optional":false,"default":null,"description":"the laser's origin position","types":["PositionASL"],"since":null,"text":"position: PositionASL - the laser's origin position"},{"name":"direction","type":"Array of Vector3D","optional":false,"default":null,"description":"the laser's direction vector","types":["Array","Vector3D"],"since":null,"text":"direction: Array of Vector3D - the laser's direction vector"},{"name":"beamColor","type":"Color (RGB)","optional":false,"default":null,"description":"laser beam color. The values can go way above the usual 0..1 range as they also act as emissivity brightness","types":["Color"],"since":null,"text":"beamColor: Color (RGB) - laser beam color. The values can go way above the usual 0..1 range as they also act as emissivity brightness"},{"name":"dotColor","type":"Color (RGB) or Empty Array","optional":false,"default":null,"description":"impact dot color. Set to `[]` to use the same value as *beamColor*.","types":["Color","Array"],"since":null,"text":"dotColor: Color (RGB) or Empty Array - impact dot color. Set to `[]` to use the same value as *beamColor*."},{"name":"dotSize","type":"Number","optional":false,"default":null,"description":"impact dot size; if set to 0 the impact dot will not render","types":["Number"],"since":null,"text":"dotSize: Number - impact dot size; if set to 0 the impact dot will not render"},{"name":"beamThickness","type":"Number","optional":false,"default":null,"description":"laser beam's thickness scale; if set to 0, the beam will not render","types":["Number"],"since":null,"text":"beamThickness: Number - laser beam's thickness scale; if set to 0, the beam will not render"},{"name":"beamMaxLength","type":"Number","optional":true,"default":"-1","description":"laser beam's maximum length. `-1` means maximum length (defined in `CfgIRLaserSettings`), `0` means no length at all and the command is ignored","types":["Number"],"since":null,"text":"beamMaxLength: Number - (Optional, default -1) laser beam's maximum length. `-1` means maximum length (defined in `CfgIRLaserSettings`), `0` means no length at all and the command is ignored"},{"name":"isIR","type":"Boolean","optional":true,"default":"true","description":"whether the laser and impact dot are only visible with Night Vision / Thermal Imaging","types":["Boolean"],"since":null,"text":"isIR: Boolean - (Optional, default true) whether the laser and impact dot are only visible with Night Vision / Thermal Imaging"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"[position, direction, beamColor, dotColor, dotSize, beamThickness, beamMaxLength, isIR]","types":["Array"]}}],"examples":[{"text":"Give the player a laser eye:\n\n```sqf\naddMissionEventHandler [\"Draw3D\", {\n    drawLaser [\n        eyePos player vectorAdd [0, 0, 0.1],\n        getCameraViewDirection player,\n        [1000, 0, 0], // Bright red\n        [],\n        5,\n        20,\n        -1,\n        false\n    ];\n}];\n```","code":["addMissionEventHandler [\"Draw3D\", {\n\tdrawLaser [\n\t\teyePos player vectorAdd [0, 0, 0.1],\n\t\tgetCameraViewDirection player,\n\t\t[1000, 0, 0], // Bright red\n\t\t[],\n\t\t5,\n\t\t20,\n\t\t-1,\n\t\tfalse\n\t];\n}];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["drawIcon3D","drawLine3D"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Command Group: Lights","Introduced with Arma 3 version 2.08","Scripting Commands","Scripting Commands: Local Effect"]}