---
name: "cursorTarget"
type: command
status: ok
groups: ["Object Detection"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/cursorTarget
revid: 373164
updated: 2025-04-08T21:03:11Z
---

# cursorTarget

*Command · Object Detection · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Returns the target pointed at by the player (usually with cross-hairs). The target has to be known to the player to some degree ([knowsAbout](../commands/knowsAbout.md) > 0). If target is completely unknown, command returns [objNull](../commands/objNull.md).

A valid target could belong to an enemy or a friendly side. Buildings are normally known to player and so are valid targets. Try [nearTargets](../commands/nearTargets.md) to see what else is considered a target.
While friendly targets are usually known to the player, enemy targets can be totally unknown, especially if "auto-spotting" (or sometimes called "auto-reporting") is switched off. To check if auto-spotting is enabled: `difficultyEnabled "autospot"`.

[cursorTarget](../commands/cursorTarget.md) also returns locked target for the duration of the lock even if there is another target under the cursor. As soon as missile is fired, [cursorTarget](../commands/cursorTarget.md) switches to current known target under cursor or [objNull](../commands/objNull.md).
Targeting (<kbd>T</kbd> in Arma 3) works regardless of the state of "auto-spotting".

Adding a target to the known list could be done with [reveal](../commands/reveal.md) command. When auto-spotting is enabled, zooming on the enemy target with cross-hairs usually reveals the target.
As friendly targets are always known, zooming on friendly target could improve [knowsAbout](../commands/knowsAbout.md) value.

Side Relations can also influence target knowledge. For example [east](../commands/east.md) target is unknown target for [civilian](../commands/civilian.md), but making them friends with [setFriend](../commands/setFriend.md) instantly improves [civilian](../commands/civilian.md) knowledge of the [east](../commands/east.md).

## Syntax

```sqf
cursorTarget
```

**Returns:** [Object](../topics/Object.md)

## Examples

### Example 1

```sqf
alive cursorTarget;
```

## See also

[cursorObject](../commands/cursorObject.md) · [getCursorObjectParams](../commands/getCursorObjectParams.md) · [laserTarget](../commands/laserTarget.md) · [nearTargets](../commands/nearTargets.md) · [knowsAbout](../commands/knowsAbout.md) · [reveal](../commands/reveal.md) · [lineIntersects](../commands/lineIntersects.md) · [lineIntersectsWith](../commands/lineIntersectsWith.md) · [lineIntersectsObjs](../commands/lineIntersectsObjs.md) · [lineIntersectsSurfaces](../commands/lineIntersectsSurfaces.md) · [intersect](../commands/intersect.md) · [checkVisibility](../commands/checkVisibility.md)

## Community notes

**FRL Myke** — 2011-02-18

If the player is in a vehicle and a lockable weapon is selected and a target is locked, the locked target will be returned, regardless if it is in sight or not.

---

**.kju** — 2011-03-11

Addition to Myke's note:
It also works for infantry with launchers that canLock, like Javelin or AA.
Only the lock cursor must be visible on the target - not a full lock necessarily.

---

**Lou Montana** — 2009-07-11

- Player must [know about](../commands/knowsAbout.md) what he is pointing to for this command to return something other than <NULL-OBJECT>
- This command doesn't work through building windows
- This recognition doesn't work with every object : soldiers, vehicles, big houses are ok, but not trees, plants, road signs or others little things

---

**Killzone_Kid** — 2013-08-23

To add to User:Lou Montana's note, use [reveal](../commands/reveal.md) command on the object you want to be detected with [cursorTarget](../commands/cursorTarget.md) when pointing at it.
Without it, distant units are most likely to return [objNull](../commands/objNull.md) even if you shoot and hit them.

Units that have been previously subjected to [enableSimulation](../commands/enableSimulation.md) false; or [enableSimulationGlobal](../commands/enableSimulationGlobal.md) false; may stay unrecognised for a long time even after simulation was re-enabled, returning [objNull](../commands/objNull.md) as [cursorTarget](../commands/cursorTarget.md).
Force revealing units with [reveal](../commands/reveal.md) command usually solves the problem. For example:

```sqf
{ player reveal _x } forEach allUnits;
```

---

**DreadedEntity** — 2014-12-03

[cursorTarget](../commands/cursorTarget.md) seems to change when your cursor enters an object's [boundingBox](../commands/boundingBox.md).
Because of this, if the player is **inside** the [boundingBox](../commands/boundingBox.md), the object will always be the current [cursorTarget](../commands/cursorTarget.md) if the player is not looking at another object, although sometimes the object will remain the [cursorTarget](../commands/cursorTarget.md) even if the player does.

---

**Pierre MGI** — 2015-04-21

[cursorTarget](../commands/cursorTarget.md) will not return enemy units, even very close, if "autoreport" is disabled in game difficulty settings, and if player is alone.
However, when enemy units open fire on player, the cursortarget becomes functional on these units. If player is in a group, cursortarget is also functional (report by other units).

---

**Pierre MGI** — 2016-02-05

CursorTarget will return a <Null_Object> for all of thus which have a disabled simulation (_object enableSimulation false).

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