Page tree
Skip to end of metadata
Go to start of metadata

Introduced in



Description:Locks a turret on an object or ASL position. To lock a turret on a relative hull position, use fn vbs lockTurretDir.


Syntax:vehicle turretLockOn [turretPath, target, trackMounted, trackHidden, keepLockWhenTrackingIsLost, updateRange]
  • vehicle: Object - Vehicle to lock.
  • turretPath: Array - Turret to lock.
  • target: PositionASL or Object - What to lock on. Locking can be reset by passing either a objNull or [0,0,0].
  • trackMounted: Boolean - Continue tracking the unit after entering a vehicle (optional, default: false) (V1.24+, no effect in VBS3).
  • trackHidden: Boolean / Number - Track the object, only if visible (Boolean), or visible enough (a Float number: 0-1) (optional, default: 1) (V1.24+, no effect in VBS3).
  • keepLockWhenTrackingIsLost: Boolean - Keep track of the object, even when it is out of turret limits (optional, default: true) (V1.24+, no effect in VBS3).
  • updateRange: Boolean - Match the FCS range, with distance to locked-on object (optional, default: true) (V18.2+).
Return Value:Nothing


tank1 turretLockOn [[0],getPosASL tank2]
tank1 turretLockOn [[0], tank2, nil, nil, nil, false] // Track without updating the FCS range automatically

Additional Information

See also: turretLockedOn, setTurretStabilization, fn vbs lockTurretDir, setTurretMaster


Requires the tracking turret to be crewed, and to be able to rotate, in order to work properly --
07:04, 24 July 2008 (CEST)