Arma 3 Scripting

setUnitTrait

  • Local argument
  • Global effect
  • Arma 3 v1.58

Command · Markdown · JSON · original wiki page

Description

Enables or disables a trait or alters a trait of the given unit. Unit traits consist of unit abilities, which are Booleans and modifiers, which are Numbers. Custom trait can only be a bool.

Note

The command can also be used on vehicles (and drones), and it will get applied to the effectiveCommander of the vehicle. In addition, if the effectiveCommander 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:

Syntax

unit setUnitTrait [skillName, value, isCustom]

Parameters:

Returns: Nothing

Examples

Example 1

player setUnitTrait ["Medic", true];

See also

getUnitTrait · getAllUnitTraits

Community notes

R3vo

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

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

Honger

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