{"name":"lockCameraTo","operator":null,"title":"lockCameraTo","type":"command","url":"https://community.bistudio.com/wiki/lockCameraTo","revid":377889,"updated":"2026-01-05T17:33:18Z","groups":["Camera Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.26"}],"since":{"game":"arma3","name":"Arma 3","version":"1.26"},"arma3_since":"1.26","branch":null,"locality":{"argument":"local","effect":null,"server_exec":false},"exec":null,"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]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"UAV","types":["Object"],"since":null,"text":"vehicle: Object - UAV"},{"name":"target","type":"Object or PositionASL","optional":false,"default":null,"description":"use objNull to unlock","types":["Object","PositionASL"],"since":null,"text":"target: Object or PositionASL - use objNull to unlock"},{"name":"turretPath","type":"Turret Path","optional":false,"default":null,"description":"path to the turret with required camera","types":["Turret Path"],"since":null,"text":"turretPath: Turret Path - path to the turret with required camera"}],"returns":{"type":"Nothing > [!IMPORTANT] >","types":["Nothing"],"description":"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","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[target, turretPath]","types":["Array"]}},{"syntax":"vehicle lockCameraTo [target, turretPath, temporary]","since":"arma3 2.08","effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"UAV","types":["Object"],"since":null,"text":"vehicle: Object - UAV"},{"name":"target","type":"Object or PositionASL","optional":false,"default":null,"description":"use objNull to unlock","types":["Object","PositionASL"],"since":null,"text":"target: Object or PositionASL - use objNull to unlock"},{"name":"turretPath","type":"Turret Path","optional":false,"default":null,"description":"path to the turret with required camera","types":["Turret Path"],"since":null,"text":"turretPath: Turret Path - path to the turret with required camera"},{"name":"temporary","type":"Boolean","optional":false,"default":null,"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.","types":["Boolean"],"since":null,"text":"temporary: Boolean - 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."}],"returns":{"type":null,"types":["Nothing"],"description":null,"text":"Nothing\n\n> [!NOTE]\n> This syntax also works with non-stabilized turrets, unlike #Syntax 1."},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[target, turretPath, temporary]","types":["Array"]}}],"examples":[{"text":"```sqf\nuav lockCameraTo [cursorObject, [0,0]];\n```","code":["uav lockCameraTo [cursorObject, [0,0]];"]},{"text":"```sqf\nuav lockCameraTo [objNull, [0,0]]; // unlocks the turret\n```","code":["uav lockCameraTo [objNull, [0,0]]; // unlocks the turret"]},{"text":"```sqf\nvehicle player lockCameraTo [enemyTarget, vehicle player unitTurret player, false];\n```","code":["vehicle player lockCameraTo [enemyTarget, vehicle player unitTurret player, false];"]}],"multiplayer":null,"problems":null,"aliases":[],"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."}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Camera Control","Introduced with Arma 3 version 1.26","Scripting Commands"]}