lockCameraTo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
(The "temporary" parameter is not optional. It's part of a new syntax)
Line 11: Line 11:
{{Feature|informative|The command is local to the targeted '''turret''', not the vehicle.}}
{{Feature|informative|The command is local to the targeted '''turret''', not the vehicle.}}


|s1= vehicle [[lockCameraTo]] [target, turretPath, temporary]
|s1= vehicle [[lockCameraTo]] [target, turretPath]


|p1= vehicle: [[Object]] - UAV
|p1= vehicle: [[Object]] - UAV
Line 19: Line 19:
|p3= turretPath: [[Array]] - path to the turret with required camera
|p3= turretPath: [[Array]] - path to the turret with required camera


|p4= temporary: [[Boolean]] - (Optional, default [[false]]) if set, the syntax also works with non-stabilised turrets.<br>
|r1= [[Nothing]]
 
|s2= vehicle [[lockCameraTo]] [target, turretPath, temporary]
|s2since= arma3 2.08
 
|p21= vehicle: [[Object]] - UAV
 
|p22= target: [[Object]] or [[Array]] format [[Position#PositionASL|PositionASL]] - use [[objNull]] to unlock
 
|p23= turretPath: [[Array]] - path to the turret with required camera
 
|p24= temporary: [[Boolean]] - This syntax also works with non-stabilised turrets.<br>
If set to [[true]], the engine will automatically remove the lock-on once the turret reaches its target.
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, the turret will move to the maximum of its capacity towards the target.
If the target is out of turret's reach, the turret will move to the maximum of its capacity towards the target.
{{Feature|important|If ''temporary'' is '''not''' set and target is out of possible view, the turret will move to its limit and get stuck there, with blocked input.}}
{{Feature|important|If ''temporary'' is '''not''' set ({{HashLink|#Syntax|syntax 1}}) and target is out of possible view, the turret will move to its limit and get stuck there, with blocked input.}}
|p4since= arma3 2.08


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


|x1= <code>uav [[lockCameraTo]] [vehicle, [0,0]];</code>
|x1= <code>uav [[lockCameraTo]] [vehicle, [0,0]];</code>

Revision as of 10:58, 27 April 2022

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.
The command is local to the targeted turret, 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

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 - This syntax also works with non-stabilised turrets.
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, the turret will move to the maximum of its capacity towards the target.
If temporary is not set (syntax 1) and target is out of possible view, the turret will move to its limit and get stuck there, with blocked input.
Return Value:
Nothing

Examples

Example 1:
uav lockCameraTo [vehicle, [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:
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.