---
name: "setUnitTrait"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "1.58"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setUnitTrait
revid: 379077
updated: 2026-09-26T23:03:38Z
---

# setUnitTrait

*Command · Object Manipulation · Arma 3 v1.58*

Locality: arguments **local** · effect **global**

## Description

Enables or disables a trait or alters a trait of the given unit. Unit traits consist of unit abilities, which are [Boolean](../topics/Boolean.md)s and modifiers, which are [Number](../topics/Number.md)s. Custom trait can only be a [bool](../topics/Boolean.md).

> [!NOTE]
> The command can also be used on vehicles (and drones), and it will get applied to the [effectiveCommander](../commands/effectiveCommander.md) of the vehicle. In addition, if the [effectiveCommander](../commands/effectiveCommander.md) has a trait, it will get applied to the entire vehicle (for example, the vehicle can become harder to spot due to low **camouflageCoef**)

Abilities:
- [Boolean](../topics/Boolean.md) **engineer** - Ability to partially repair vehicles with toolkit, equivalent to  in CfgVehicles
- [Boolean](../topics/Boolean.md) **explosiveSpecialist** - Ability to defuse mines with toolkit, equivalent to  in CfgVehicles
- [Boolean](../topics/Boolean.md) **medic** - Ability to treat self and others with medikit, equivalent to  in CfgVehicles
- [Boolean](../topics/Boolean.md) **UAVHacker** - Ability to hack enemy and friendly drones, equivalent to  in CfgVehicles
Modifiers:
- [Number](../topics/Number.md) **audibleCoef** - A lower value means the unit is harder to hear
- [Number](../topics/Number.md) **camouflageCoef** - A lower value means the unit is harder to spot
- [Number](../topics/Number.md) **loadCoef** - Equipment weight multiplier affecting stamina regeneration and max stamina
- [Number](../topics/Number.md) **staminaDrainCoef** - Since Arma 3 v2.22, Influences how quickly stamina is drained. **Do not set negative values!**

## Syntax

```sqf
unit setUnitTrait [skillName, value, isCustom]
```

**Parameters:**

- `unit`: [Object](../topics/Object.md) - the unit whose trait should be set
- `skillName`: [String](../topics/String.md) - name of the skill
- `value`: [Boolean](../topics/Boolean.md) or [Number](../topics/Number.md) - value (see above)
- `isCustom`: [Boolean](../topics/Boolean.md) - (Optional) Must be set to [true](../commands/true.md) in case of custom

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

## Examples

### Example 1

```sqf
player setUnitTrait ["Medic", true];
```

## See also

[getUnitTrait](../commands/getUnitTrait.md) · [getAllUnitTraits](../commands/getAllUnitTraits.md)

## Community notes

**R3vo** — 2016-04-27

The higher the value for the loadCoef the less stamina a unit has. Negative values will dramatically increase the stamina actually to a point where it extends the stamina bar.

---

**Midnight** — 2017-10-20

The `explosiveSpecialist` trait can defuse mines (i.e. satchel charges), whilst the engineer trait alone cannot.

---

**Honger** — 2026-09-26

Setting **staminaDrainCoef** to a negative value will gradually replenish stamina/reduce fatigue when running/sprinting. Walking or standing will not be affected.

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