---
name: "playerTargetLock"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "2.18"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/playerTargetLock
revid: 377647
updated: 2026-01-02T09:01:49Z
---

# playerTargetLock

*Command · Object Manipulation · Arma 3 v2.18*

## Description

Get the local player's current locked target (with weapons that can lock on).

## Syntax

```sqf
playerTargetLock
```

**Returns:** [Array](../topics/Array.md) with [target, lockValue, config]
- target: [Object](../topics/Object.md) - the locked object
- lockValue: [Number](../topics/Number.md) - in range 0..1 where 1 is fully locked
- config: [Config](../topics/Config.md) - used weapon's `CfgWeapons` config

## Examples

### Example 1

```sqf
playerTargetLock params ["_target", "_lock", "_cfg"];
if (_lock == 1) then
{
    hint format ["%1 locked %2", getText (_cfg >> "displayName"), getText (configOf _target >> "displayName")];
};
```

### Example 2

```sqf
playerTargetLock; // returns [objNull, 0, configNull] if no lock is being done
```

## See also

[cursorTarget](../commands/cursorTarget.md)

<sub>Source: [BI Community Wiki — playerTargetLock](https://community.bistudio.com/wiki/playerTargetLock) (revision 377647).</sub>
