Arma 3 Scripting

lockCameraTo

  • Local argument
  • Arma 3 v1.26

Command · Markdown · JSON · original wiki page

Description

Lock/Unlock stabilized camera to target. Works only on turrets which have optic mode selected with direction stabilization enabled.

Note

Since Arma 3 v2.08 the command also works with non-stabilized turrets (such as main turret of a tank). See syntax 2.

Note

The command is local to the turret gunner, not the vehicle.

Syntax

Syntax 1

vehicle lockCameraTo [target, turretPath]

Parameters:

Returns: Nothing

Important

  • This syntax only works with stabilized turrets.
  • When using this syntax, if target is out of possible view, the turret will move to its limit and get stuck there, with blocked input.

Syntax 2

since arma3 2.08

vehicle lockCameraTo [target, turretPath, temporary]

Parameters:

Returns: Nothing

Note

This syntax also works with non-stabilized turrets, unlike #Syntax 1.

Examples

Example 1

uav lockCameraTo [cursorObject, [0,0]];

Example 2

uav lockCameraTo [objNull, [0,0]]; // unlocks the turret

Example 3

vehicle player lockCameraTo [enemyTarget, vehicle player unitTurret player, false];

See also

lockedCameraTo · camTarget · camSetTarget · camPrepareTarget · directionStabilizationEnabled · enableDirectionStabilization

Community notes

Commy2

The vehicle has to have a stabilized optic for this command to work with ASL position.