lockCameraTo: Difference between revisions

From Bohemia Interactive Community
No edit summary
mNo edit summary
 
Line 40: Line 40:


|p24= temporary: [[Boolean]] - if set to [[true]], the engine will automatically remove the lock-on once the turret reaches its target.
|p24= temporary: [[Boolean]] - if set to [[true]], the engine will automatically remove the lock-on once the turret reaches its target.
If the target is out of turret's reach, once the turret riches its [[getTurretLimits | limits]] the lock-on will be released.
If the target is out of turret's reach, once the turret reaches its [[getTurretLimits | limits]] the lock-on will be released.


|r2= [[Nothing]]
|r2= [[Nothing]]

Latest revision as of 03:07, 21 October 2025

Hover & click on the images for description

Description

Description:
Lock/Unlock stabilized camera to target. Works only on turrets which have optic mode selected with direction stabilization enabled.
Since Arma 3 logo black.png 2.08 the command also works with non-stabilized turrets (such as main turret of a tank). See syntax 2.
The command is local to the turret gunner, not the vehicle.
Groups:
Camera Control

Syntax

Syntax:
vehicle lockCameraTo [target, turretPath]
Parameters:
vehicle: Object - UAV
target: Object or Array format PositionASL - use objNull to unlock
turretPath: Array - path to the turret with required camera
Return Value:
Nothing
  • 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.

Alternative Syntax

Syntax:
vehicle lockCameraTo [target, turretPath, temporary]
Parameters:
vehicle: Object - UAV
target: Object or Array format PositionASL - use objNull to unlock
turretPath: Array - path to the turret with required camera
temporary: Boolean - if set to true, the engine will automatically remove the lock-on once the turret reaches its target. If the target is out of turret's reach, once the turret reaches its limits the lock-on will be released.
Return Value:
Nothing
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];

Additional Information

See also:
lockedCameraTo camTarget camSetTarget camPrepareTarget directionStabilizationEnabled enableDirectionStabilization

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Commy2 - c
Posted on Apr 10, 2015 - 06:54 (UTC)
The vehicle has to have a stabilized optic for this command to work with ASL position.