Arma 3 Scripting

drawLaser

  • Local effect
  • Arma 3 v2.08

Command · also in Lights · Markdown · JSON · original wiki page

Description

Draws a laserbeam and a lightpoint at the impact location of the laser.

This command has to be executed every frame - see Arma 3: Mission Event Handlers#Draw3D.

Lasers drawn with this command are subject to the same limitations as weapon attachment lasers. These limitations are defined in the CfgIRLaserSettings config class.

Syntax

drawLaser [position, direction, beamColor, dotColor, dotSize, beamThickness, beamMaxLength, isIR]

Parameters:

Returns: Nothing

Examples

Example 1

Give the player a laser eye:

addMissionEventHandler ["Draw3D", {
    drawLaser [
        eyePos player vectorAdd [0, 0, 0.1],
        getCameraViewDirection player,
        [1000, 0, 0], // Bright red
        [],
        5,
        20,
        -1,
        false
    ];
}];

See also

drawIcon3D · drawLine3D