{"name":"lockCameraTo","title":"lockCameraTo","type":"command","url":"https://community.bistudio.com/wiki/lockCameraTo","revid":377889,"updated":"2026-01-05T17:33:18Z","groups":["Camera Control"],"status":"ok","games":{"arma3":"1.26"},"since":"arma3 1.26","arma3_since":"1.26","locality":{"argument":"local"},"description":"Lock/Unlock stabilized camera to target. Works only on turrets which have optic mode selected with direction stabilization enabled.\n\n> [!NOTE]\n> Since Arma 3 v2.08 the command also works with non-stabilized turrets (such as main turret of a tank). See syntax 2.\n\n> [!NOTE]\n> The command is local to the **turret** gunner, not the vehicle.","syntaxes":[{"syntax":"vehicle lockCameraTo [target, turretPath]","params":[{"name":"vehicle","type":"Object","description":"UAV","type_expr":"Object"},{"name":"target","type":"Object or PositionASL","description":"use objNull to unlock","type_expr":"Object | PositionASL"},{"name":"turretPath","type":"Turret Path","description":"path to the turret with required camera","type_expr":"Turret Path"}],"returns":{"type":"Nothing","type_expr":"Nothing","description":"> [!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.","text":"Nothing\n\n> [!IMPORTANT]\n> - This syntax only works with stabilized turrets.\n> - 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."},"form":"binary","left":{"text":"vehicle"},"right":{"text":"[target, turretPath]"}},{"syntax":"vehicle lockCameraTo [target, turretPath, temporary]","since":"arma3 2.08","params":[{"name":"vehicle","type":"Object","description":"UAV","type_expr":"Object"},{"name":"target","type":"Object or PositionASL","description":"use objNull to unlock","type_expr":"Object | PositionASL"},{"name":"turretPath","type":"Turret Path","description":"path to the turret with required camera","type_expr":"Turret Path"},{"name":"temporary","type":"Boolean","description":"if set to true, the engine will automatically remove the lock-on once the turret reaches its target.\nIf the target is out of turret's reach, once the turret reaches its limits the lock-on will be released.","type_expr":"Boolean"}],"returns":{"type":"Nothing","type_expr":"Nothing","description":"> [!NOTE] > This syntax also works with non-stabilized turrets, unlike Syntax 1.","text":"Nothing\n\n> [!NOTE]\n> This syntax also works with non-stabilized turrets, unlike Syntax 1."},"form":"binary","left":{"text":"vehicle"},"right":{"text":"[target, turretPath, temporary]"}}],"examples":[{"code":["uav lockCameraTo [cursorObject, [0,0]];"]},{"code":["uav lockCameraTo [objNull, [0,0]]; // unlocks the turret"]},{"code":["vehicle player lockCameraTo [enemyTarget, vehicle player unitTurret player, false];"]}],"see_also":["lockedCameraTo","camTarget","camSetTarget","camPrepareTarget","directionStabilizationEnabled","enableDirectionStabilization"],"notes":[{"user":"Commy2","date":"2015-04-10T06:54:00Z","text":"The vehicle has to have a stabilized optic for this command to work with ASL position."}]}