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

# setOpticsMode

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

## Description

Sets the optic mode of the current weapon to the given class name or the index.

## Syntax

```sqf
unit setOpticsMode mode
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)
- `mode`: [String](../topics/String.md), [Number](../topics/Number.md) or [Array](../topics/Array.md):
  - [String](../topics/String.md) - class name defined in the optic's `OpticsModes` config class
  - [Number](../topics/Number.md) - 0-based index of the optic mode with 0 being the default optic mode
  - [Array](../topics/Array.md) with [slotIndex, opticsModeIndexOrClassName]
    - slotIndex: [Number](../topics/Number.md), can be one of:
      - 0 - Current weapon
      - 1 - Primary weapon
      - 2 - Secondary weapon
      - 3 - Handgun
    - opticsModeIndexOrClassName: [String](../topics/String.md) or [Number](../topics/Number.md) as above

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

## Examples

### Example 1

```sqf
player setOpticsMode "Hamr2Scope"; // Default optic mode for optic_Hamr
```

### Example 2

```sqf
player setOpticsMode 0;
```

### Example 3

```sqf
player setOpticsMode [1, 0]; // reset the optics mode of the player's primary weapon to the default
```

## See also

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

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